Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C 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 and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
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 Programmers 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].
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).
527192-018 Hewlett-Packard Company 5109