fmod(), fmodf()

floating-point remainder function 

Function


SYNOPSIS

#include <math.h>

double fmod(double x, double y)

float fmodf(float x, float y)


DESCRIPTION

The fmod() function computes the floating-point remainder of x/y.

An application wishing to check for error situations should set errno to 0 before calling fmod(). If errno is non-zero on return, or the return value is NaN, an error has occurred.

The fmodf() function is a single-precision version of fmod().


PARAMETERS

x 

Is the dividend for which the remainder is desired.

y 

Is the divisor for which the remainder is desired.


RETURN VALUES

The fmod() function returns the value x - i * y, for some integer i such that, if y is non-zero, the result has the same sign as x and magnitude less than the magnitude of y.

If x or y is NaN, NaN is returned.

If y is 0 and if x is not NaN, then:

If y is 0, or if x is +Infinity or -Infinity, either 0 or NaN is returned.

If y is non-zero, fmod(0, y) returns the value of x. If x is not +Infinity or -Infinity, fmod(x, +Infinity) or fmod(x, -Infinity) returns the value of x.

If the result underflows, 0 is returned.


CONFORMANCE

fmod(): UNIX 98

fmodf(): PTC MKS Toolkit UNIX APIs extension


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
fabs(), floor(), frexp(), modf()


PTC MKS Toolkit 10.4 Documentation Build 39.