DivRemUF16

Computes the quotient and remainder of a 16.16 division.

Synopsis

ufrac16 DivRemUF16( ufrac16 *rem, ufrac16 d1, ufrac16 d2 )

Description

This function divides one unsigned 16.16 fraction by another and returns the quotient and remainder. This function returns a correct 16.16 result if the arguments are uint32 or ufrac30, as long as both arguments, d1 and d2, are the same type.

The remainder is not a 16.16 fraction; instead, it is an unsigned fraction in 0.32 format. An overflow condition is signaled by maximum return in both values.

Arguments

rem
A pointer to a unsigned fraction in 0.32 format to store the remainder.
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

Caveats

The function does not detect overflows.

See Also

DivRemSF16(), DivRemS32(), DivRemU32(), DivSF16(), DivUF16(), DivU64(), DivS64()