REMQUO(3) NEWLIB REMQUO(3)NAME
1.47 `remquo', `remquof'-remainder and part of quotient
SYNOPSIS
#include <math.h>
double remquo(double X, double Y, int *QUO);
float remquof(float X, float Y, int *QUO);
DESCRIPTION
The `remquo' functions compute the same remainder as the `remainder'
functions; this value is in the range -Y/2 ... +Y/2. In the object
pointed to by `quo' they store a value whose sign is the sign of
`x'/`y' and whose magnitude is congruent modulo 2**n to the magnitude
of the integral quotient of `x'/`y'. (That is, `quo' is given the n
lsbs of the quotient, not counting the sign.) This implementation uses
n=31 if int is 32 bits or more, otherwise, n is 1 less than the width
of int.
For example:
remquo(-29.0, 3.0, &QUO)
returns -1.0 and sets QUO=10, and
remquo(-98307.0, 3.0, &QUO)
returns -0.0 and sets QUO=-32769, although for 16-bit int, QUO=-1.
In the latter case, the actual quotient of -(32769=0x8001) is reduced
to -1 because of the 15-bit limitation for the quotient.
RETURNS
When either argument is NaN, NaN is returned. If Y is 0 or X is infi‐
nite (and neither is NaN), a domain error occurs (i.e. the "invalid"
floating point exception is raised or errno is set to EDOM), and NaN is
returned. Otherwise, the `remquo' functions return X REM Y.
*Bugs*
IEEE754-2008 calls for `remquo'(subnormal, inf) to cause the "under‐
flow" floating-point exception. This implementation does not.
PORTABILITY
C99, POSIX.
SEE ALSO
remquo is part of the library. The full documentation for is main‐
tained as a Texinfo manual. If info and are properly installed at your
site, the command
info
will give you access to the complete manual.
NEWLIB April 2010 REMQUO(3)