Important: The information in this document is obsolete and should not be used for new development.
WideWideDivide
You can use theWideWideDividefunction to calculate awidequotient andlongremainder for awidedividend and alongdivisor.
wide *WideWideDivide(wide *dividend, long divisor, long *remainder);
dividend- A pointer to the
widenumber 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
- A pointer to the quotient (also to the dividend).
DESCRIPTION
TheWideWideDividefunction returns the quotient of the dividend and divisor as its function result and places the remainder in theremainderparameter. If theremainderparameter isnil,WideWideDividereturns the rounded quotient. The quotient replaces the dividend. 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 the
remainderparameter isnil, no remainder is returned and theWideDividefunction returns a rounded quotient. Passing(long *)-1in theremainderparameter is the same as passingnil.Note that this function cannot result in overflow.