|
|
HP-UX Reference > Rremainder(3M)HP-UX 11i Version 2: December 2007 Update |
|
NAMEremainder(), remainderf(), remainderl(), remainderw(), remainderq(), drem(), dremf(), dreml(), dremw(), dremq() — remainder functions SYNOPSIS#include <math.h> double remainder(double x, double y); HP Integrity Server Onlyfloat 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); double drem(double x, double y); float dremf(float x, float y); long double dreml(long double x, long double y); extended dremw(extended x, extended y); quad dremq(quad x, quad y); DESCRIPTIONThe 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 | = ˝, the value n is chosen to be even. The remainder() function is independent of the rounding mode. Integrity Server Onlydrem() is equivalent to remainder(). It is provided in HP-UX to facilitate importing code from other platforms. remainderf() and dremf() are float versions of remainder() and drem(); they take float arguments and returns a float result. remainderl() and dreml() are long double versions of remainder() and drem(); they take long double arguments and returns a long double result. remainderw() and dremw() are extended version of remainder() and drem(); they take extended arguments and returns an extended result. remainderq() and dremq() are equivalent to remainderl() and dreml() on HP-UX systems. USAGETo use these functions, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options. To use (for Integrity servers) remainderw(), remainderq(), dremw(), or dremq(), compile also with the -fpwidetypes option. Make sure your program includes <math.h>. Link in the math library by specifying -lm on the compiler or linker command line. RETURN VALUEIf 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. |
|