remainder(), remainderf(), drem(), dremf(), remquo(), remquof()

minimal residue functions 

Function


SYNOPSIS

#include <math.h>

double remainder(double x, double y);

float remainderf(float x, float y);

double drem(double x, double y);

float dremf(float x, float y);

double remquo(double x, double y, int *quo);

float remquof(float x, float y, int *quo);


DESCRIPTION

The remainder() function returns the remainder r:

x - n * y;

where n is the integer nearest the exact value of x/y; if |n - x/y| = 1/2, then n is even.

The drem() function is identical to remainder().

The remainderf() and dremf() functions are single-precision versions of remainder() and drem() respectively.

The remquo(), and remquof() functions also store the last k bits of n in the location pointed to by quo, provided that n exists. The number of bits k is platform-specific, but is guaranteed to be at least 3.


PARAMETERS

x 

The value of the numerator.

y 

The value of the denominator.

quo 

Location to store the last 3 or more bits of n.


RETURN VALUES

The remainder() function returns the remainder r as defined above.

If y is 0.0 or x is Infinity and y is 0.0, remainder() returns NaN. If in POSIX mode, errno is set to EDOM, if in SVID or XOPEN modes, matherror() is called.


CONFORMANCE

remainder(), remainderf(), remquo() and remquof(): ANSI/ISO 9899:1999 'ISO C99'.

drem() and dremf(): 4.4BSD


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:
fmod(), math()


PTC MKS Toolkit 10.5 Documentation Build 40.