FMOD 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

fmodf, fmod, fmodl, fmodw, fmodq, fmodll, fmoddf, fmodd, fmoddl, fmoddll - floating-point remainder value function

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float fmodf (float x, float y);

extern double fmod (double x, double y);

extern long double fmodl (long double x, long double y);

extern __float80 fmodw (__float80 x, __float80 y);

extern __float128 fmodq (__float128 x, __float128 y);

extern long_long_double fmodll (long_long_double x, long_long_double y);

extern decimal_float fmoddf (decimal_float x, decimal_float y);

extern decimal_double fmodd (decimal_double x, decimal_double y);

extern decimal_long_double fmoddl (decimal_long_double x, decimal_long_double y);

extern decimal_long_long_double fmoddll (decimal_long_long_double x, decimal_long_long_double y);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the value x - n*y, for some integer n such that the result has the same sign as x, and magnitude less than that of y. This operation is always exact, and the magnitude of the result always lies in [0, |y|), and has the same sign as x.

Caution: When the quotient x / y is of large magnitude, the computation can take a relatively long time (many thousands of floating-point instructions).


RETURN VALUES

Return the value of x - n*y.

ERRORS

If either argument is a NaN, or if both are NaNs, or if the first argument is +Infinity or -Infinity, or if the second argument is zero, set errno to EDOM, and return a NaN.

SEE ALSO

remainder(3CW), remquo(3CW).