Important: The information in this document is obsolete and should not be used for new development.
WideDivide
You can use theWideDividefunction to calculate thelongquotient andlongremainder for awidedividend andlongdivisor.
long WideDivide(const 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
- The quotient of the division.
DESCRIPTION
TheWideDividefunction divides the dividend by the divisor and returns the quotient in the function result and the remainder in thelongnumber pointed to by theremainderparameter. 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
remainderparameter isnil, no remainder is returned and theWideDividefunction returns a rounded quotient. Passing(long *)-1in theremainderparameter is the same as passingnilexcept in the case of an overflow, in which casegxNegativeInfinityis returned.