Compute the remainder of two numbers
#include <math.h>
double drem ( double x,
double y );
float dremf ( float x,
float y );
libm
The drem() and dremf() functions compute the remainder r = x - ny when y is nonzero. The value n is the integral value nearest the exact value x/y.
When |n - x/y| = 1/2, the value n is chosen to be even. But remainder(x, 0) and remainder(infinity,0) are invalid operations that produce a NAN.
The behavior of drem() is independent of the rounding mode.
The remainder r = x - ny when y is nonzero.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |