drem(3m) DG/UX 4.30 drem(3m)
NAME
drem - IEEE floating-point remainder
SYNOPSIS
#include <ieeefp.h> /* for IEEE environment */
or
#include <math.h> /* for System V environment */
double drem (x,y)
double x, y;
DESCRIPTION
Drem returns the remainder of x/y as specified by IEEE
Standard 754 for Binary Floating-Point Arithmetic. The
remainder r is calculated as
r = x - n * y
where n is the integer nearest the exact value of x/y. If
the absolute value of x/y is .5, then n is the even integer
nearest the result of x/y. Since the IEEE standard requires
that the exact value of x/y be used in the calculation, the
'round nearest' rounding mode is in effect throughout the
execution of the drem function. The remainder is always
considered to be exact, so inexact exceptions are never
raised.
SEE ALSO
fpgetround(3C), isnan(3C).
DIAGNOSTICS
The IEEE standard defines drem(x, 0) and drem(infinity, y)
to be invalid operations. In addition, this implementation
considers drem(x, y) to be an invalid operation when x/y
results in infinity or double-precision overflow. These
operations raise an 'invalid operation' exception, which
results in signal SIGFPE if traps are enabled and a NaN
otherwise.
BUGS
This implementation of drem does not allow exceptional
values to be fixed by a trap handler.
Licensed material--property of copyright holder(s) Page 1