REMAINDER(3) | Library Functions Manual | REMAINDER(3) |
double
remainder(double x, double y);
float
remainderf(float x, float y);
double
remquo(double x, double y, int *quo);
float
remquof(float x, float y, int *quo);
where n is the integral value nearest to the exact value of x / y. If
the value n is chosen to be even. Consequently, the remainder is computed exactly and | r | ≤ | y | / 2 .
Also the remquo() and remquof() functions calculate the remainder as described above. But these additionally use quo to store a value whose sign is the sign of x / y and whose magnitude is congruent modulo 2^k to the magnitude of the integral quotient of x / y, where k is an implementation-defined integer greater than or equal to 3.
The rationale of the remquo() family of functions relates to situations where only few bits of the quotient are required. The exact representation of the quotient may not be meaningful when x is large in magnitude compared to y.
September 18, 2011 | NetBSD 6.1 |