Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 8 - QuickDraw GX Mathematics / QuickDraw GX Mathematics Reference
Mathematical Functions / Operations on wide Numbers


WideDivide

You can use the WideDivide function to calculate the long quotient and long remainder for a wide dividend and long divisor.

long WideDivide(const wide *dividend, long divisor,
                long *remainder);
dividend
A pointer to the wide number to be divided.
divisor
The number by which the dividend is to be divided.
remainder
A pointer to a location to store the remainder of the division.
function result
The quotient of the division.
DESCRIPTION
The WideDivide function divides the dividend by the divisor and returns the quotient in the function result and the remainder in the long number pointed to by the remainder parameter. If the dividend is a and the divisor is b, the quotient a / b is returned with a remainder. The operation has a bias of 0 bits; the bias of the result is the difference between the biases of the dividend and the divisor. The bias of the remainder is the same as the bias of the dividend.

If an overflow occurs, the result is pinned to the closest infinity and the remainder is set to gxNegativeInfinity (an impossible remainder).

If the remainder parameter is nil, no remainder is returned and the WideDivide function returns a rounded quotient. Passing (long *)-1 in the remainder parameter is the same as passing nil except in the case of an overflow, in which case gxNegativeInfinity is returned.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996