Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

nextafter(3) OSS Library Calls Reference Manual
NAME
nextafter - Computes the next representable double-precision floating-point number
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
#include <math.h>
double nextafter(
double x,
double y
);
PARAMETERS
x Is a double-precision floating-point number.
y Is a double-precision floating-point number.
DESCRIPTION
The nextafter( ) function calculates the next representable double-precision floating-point value
following the value of the x parameter in the direction of the y parameter.
When the value of x is less than the value of y, the nextafter( ) function returns the smallest
representable floating-point number greater than x. When the value of x is greater than the value
of y, the nextafter( ) function returns the largest representable floating-point number less than x.
When x equals y, the result is y.
NOTES
The nextafter( ) 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 nextafter( ) function returns the next representable double-precision floating-point value fol-
lowing the value of the x parameter in the direction of the y parameter.
For IEEE floating-point data, the following are true:
If the value of either x or y is NaN, a quiet NaN is returned.
When the value of x is infinite, the value of x is returned.
No exception is signaled when x equals y.
When the value of x is finite but nextafter(x, y) would cause overflow, the nextafter ( ) function
returns positive or negative HUGE_VAL and sets errno to [ERANGE].
58 Hewlett-Packard Company 527187-017