Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Mathematical Library Functionsremainder(3M)


NAME

 remainder - remainder function

SYNOPSIS

 
#include <math.h>
double remainder(double x, double y);

DESCRIPTION

 

The remainder() function returns the floating point remainder r = x - ny when y is non-zero. The value n is the integral value nearest the exact value x/y. When |n - x/y| = ½, the value n is chosen to be even.

The behavior of remainder() is independent of the rounding mode.

RETURN VALUES

 

The remainder() function returns the floating point remainder r = x - ny when y is non-zero.

When y is 0, remainder() returns NaN. and sets errno to EDOM.

If the value of x is +-Inf, remainder() returns NaN and sets errno to EDOM.

If x or y is NaN, then the function returns NaN.

ERRORS

 

The remainder() function will fail if:

EDOM
The y argument is 0 or the x argument is positive or negative infinity.

USAGE

 

The remainder() function computes the remainder x REM y required by ANSI/IEEE 754 (IEC 559).

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

fmod(3M), attributes(5)


SunOS 5.9Go To TopLast Changed 29 Dec 1996

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.