DivRemSF16
Computes the quotient and remainder of a 16.16 division.
Synopsis
frac16 DivRemSF16( frac16 *rem, frac16 d1, frac16 d2 )
Description
This function divides one signed 16.16 fraction by another and returns the quotient and remainder. This function returns a correct result if the arguments are int32 or frac30, as long as both d1 and d2 are the same type.
The remainder is not a 16.16 fraction; instead, it is a signed fraction in 0.32 format. The most-significant bit of the remainder is a sign bit, and this must be extended if the remainder is to be used in subsequent calculations. An overflow value is denoted by maximum positive return in both values.
Arguments
- rem
- A pointer to the remainder of the division, a signed fraction in 0.32 format.
- d1
- The dividend.
- d2
- The divisor.
Return Value
The function returns the quotient of the division. The remainder is deposited in the location pointed to by the rem argument.
Implementation
Folio call implemented in operamath V20.
Associated Files
operamath.h, operamath.lib
See Also
DivRemU32
(), DivRemS32(), DivU64(), DivUF16(), DivSF16(), DivRemUF16(), DivS64()