remainder(3M)
NAME
remainder − remainder function
SYNOPSIS
#include <math.h>
double remainder(double x, double y);
DESCRIPTION
The remainder() function returns the floating point remainder r = x − ny when y is non-zero. The value n is the integral value nearest the exact value x/y. When
│n − x/y│ = ½, the value n is chosen to be even.
The behaviour of remainder() is independent of the rounding mode.
RETURN VALUES
The remainder() function returns the floating point remainder r = x − ny when y is non-zero.
When y is 0, remainder() returns NaN. and sets errno to EDOM.
If the value of x is ±Inf, remainder() returns NaN and sets errno to EDOM.
If x or y is NaN, then the function returns NaN.
ERRORS
The remainder() function will fail if:
EDOM The y argument is 0 or the x argument is positive or negative infinity.
USAGE
The remainder() function computes the remainder x REM y required by ANSI/IEEE 754 (IEC 559).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| MT-Level | MT-Safe |
SEE ALSO
SunOS 5.6 — Last change: 29 Dec 1996