HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)

r
remainder(3M) remainder(3M)
NAME
remainder( ), remainderf( ), remainderl( ), remainderw( ), remainderq( ) - remainder functions
SYNOPSIS
#include <math.h>
double remainder(double x, double y);
Itanium(R)-based System Only
float remainderf(float x, float y);
long double remainderl(long double x, long double y);
extended remainderw(extended x, extended y);
quad remainderq(quad x, quad y);
DESCRIPTION
The remainder() function returns the floating-point remainder r = x ny when y is a nonzero number.
The value n is the integral value nearest the exact value x/y; when n x/y =⁄
1
2, the value n is chosen to
be even.
The
remainder() function is independent of the rounding mode.
Itanium-based System Only
remainderf() is a float version of remainder(); it takes float arguments and returns a float
result.
remainderl() is a long double version of remainder(); it takes long double arguments
and returns a long double result.
remainderw() is an extended version of remainder(); it takes extended arguments and returns
an extended result.
remainderq() is equivalent to remainderl() on HP-UX systems.
USAGE
To use these functions, compile either with the default
-Ae option or with the
-Aa and
-D_HPUX_SOURCE options.
To use (for Itanium-based systems)
remainderw() or remainderq(), compile also with the
-fpwidetypes option.
Make sure your program includes
<math.h>. Link in the math library by specifying -lm
on the com-
piler or linker command line.
RETURN VALUE
If y is ±INFINITY and x is not ±INFINITY,
remainder() returns x.
If x is ±zero and y is a nonzero number,
remainder() returns x.
If x or y is NaN,
remainder() returns NaN.
If y is zero,
remainder() returns NaN and raises the invalid exception.
If x is ±INFINITY,
remainder() returns NaN and raises the invalid exception.
ERRORS
If y is zero or x is infinite,
remainder() sets errno to [EDOM].
Itanium-based System Only
HP-UX
libm functions on Itanium-based systems do not set errno by default. For errno setting, com-
pile with the +Olibmerrno option and the (default) +Olibcalls option.
SEE ALSO
fmod(3M), fabs(3M), remquo(3M), math(5).
STANDARDS CONFORMANCE
remainder() : SVID3, XPG4.2, IEEE-754, ISO/IEC C99 (including Annex F, ‘‘IEC 60559 floating-point
arithmetic’’)
HP-UX 11i Version 2: August 2003 1 Hewlett-Packard Company Section 3855