[Previous] [Contents] [Next]

drem(), dremf()

Compute the remainder of two numbers

Synopsis:

#include <math.h>

double drem ( double x,
              double y );

float dremf ( float x,
              float y );

Library:

libm

Description:

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.

Returns:

The remainder r = x - ny when y is nonzero.

Classification:

Unix

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

remainder()


[Previous] [Contents] [Next]