Open System Services Library Calls Reference Manual (G06.28+, H06.05+)
OSS Library Calls (n - r) remainder(3)
NAME
|
remainder - Computes the remainder of a division operation |
LIBRARY |
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL |
G-series native OSS processes: /G/system/sysnn/zcresrl |
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL |
H-series OSS processes: /G/system/zdllnnn/zcredll |
SYNOPSIS
|
double remainder( |
double x, |
double y |
); |
PARAMETERS
|
x ||
Is a double-precision
floating-point number. |
y ||
Is a double-precision floating-point number. |
DESCRIPTION |
The remainder() function returns the floating-point remainder r where r = x - n*y and y is |
nonzero. The value n is the integral value nearest to the real value of x/y. When the absolute |
value of n - x / y is equal to 0.5, the value n is chosen to be even. |
The behavior of the remainder() function is not affected by the rounding mode. |
NOTES |
The remainder() function can be called only by native processes. |
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values. |
IEEE values can include NaN and infinity, and the sign of 0.0 (zero) can be either positive or |
negative. Refer to the fp_class(3) reference page for a description of IEEE value classes. |
Guardian functions are available to convert between floating-point formats. Refer to the Guar- |
dian Programmer’s Guide for a discussion of floating-point conversions. |
RETURN VALUES
|
The remainder() function returns the floating-point remainder r where r = x - n*y and y is |
nonzero. |
For IEEE floating-point values: |
|
• ||
When the value of x or y is NaN, the remainder() function returns NaN. |
|
• ||
When the value of x is positive or negative infinity or the value of y is 0.0 (zero), the |
remainder() function returns NaN and sets errno to [EDOM]. |
For Tandem floating-point values, when the value of the y parameter is 0.0 (zero), the |
remainder() function returns HUGE_VAL and sets errno to [EDOM]. |
527187-007 Hewlett-Packard Company 5−103