Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

remainder(3) Guardian Native C Library Calls Reference Manual
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 oating-point number.
y Is a double-precision oating-point number.
DESCRIPTION
The remainder() function returns the oating-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 oating-point and Tandem oating-point values.
IEEE values can include NaN and innity, 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 oating-point formats. Refer to the Guar-
dian Programmers Guide for a discussion of oating-point conversions.
RETURN VALUES
The remainder() function returns the oating-point remainder r where r = x - n*y and y is
nonzero.
For IEEE oating-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 innity or the value of y is 0.0 (zero), the
remainder() function returns NaN and sets errno to [EDOM].
For Tandem oating-point values, when the value of the y parameter is 0.0 (zero), the
remainder() function returns HUGE_VAL and sets errno to [EDOM].
ERRORS
If any of the following conditions occurs, the remainder() function sets errno to the
corresponding value:
[EDOM] One of the following conditions exists:
The value of the y parameter is 0.0 (zero).
572 Hewlett-Packard Company 527192-005