Everything

fmodl [V1.08 or later]


Calculate the remainder

[Classification]

Mathematical library

[Syntax]

#include <math.h>

long double __far fmodl(long double x, long double y); (C99)

[Return value]

Returns a floating-point value that is the remainder resulting from dividing x by y.

If x or y is a Not-a-Number (NaN) , fmodl returns a Not-a-Number (NaN) and sets macro EDOM to global variable errno.

If x is ±∞ or y is zero, fmodl returns a Not-a-Number (NaN) and sets macro EDOM to global variable errno.

If x is not ±∞ or y is ±∞, fmodl returns x and sets macro EDOM to global variable errno.

[Description]

This function calculates a floating-point value that is the remainder resulting from dividing x by y. In other words, the value of "x - i * y" for integer i is calculated when y is not 0. The result has the same sign as that of x, and the absolute value is smaller than that of y.