[Contents] [Previous Section] [Next Section] [Index]


drem-Remainder

Interface

F_TYPE drem (F_TYPE x, F_TYPE y)

Description

drem() returns the remainder r = x-n*y, where n = rint(x /y). Additionally, if |n-x/y|=1/2, then n is even. The remainder is computed exactly, and |r| is less than or equal to |y|/2. The drem() and remainder() functions are aliases of each other.

IEEE Std 754 defines drem(x,0) and drem(infinity,y) to be invalid operations that produce a NaN.

Exceptions


Exceptional Argument       Routine Behavior

y = 0                      Invalid argument

x = infinity               Invalid argument