Important: The information in this document is obsolete and should not be used for new development.
WideWideDivide
You can use theWideWideDivide
function to calculate awide
quotient andlong
remainder for awide
dividend and along
divisor.
wide *WideWideDivide(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
- A pointer to the quotient (also to the dividend).
DESCRIPTION
TheWideWideDivide
function returns the quotient of the dividend and divisor as its function result and places the remainder in theremainder
parameter. If theremainder
parameter isnil
,WideWideDivide
returns 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
remainder
parameter isnil
, no remainder is returned and theWideDivide
function returns a rounded quotient. Passing(long *)-1
in theremainder
parameter is the same as passingnil
.Note that this function cannot result in overflow.