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


fmod-Modulo Remainder

Interface

F_TYPE fmod (F_TYPE x, F_TYPE y) 

Description

fmod() computes the floating-point remainder of x modulo y. It returns the remainder r = x-n*y, where n = trunc(x/y). The remainder is computed exactly.

The result has the same sign as x and a magnitude less than the magnitude of y.

Exceptions


Exceptional Argument Routine Behavior x = infinity Invalid argument y = 0 Invalid argument