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

nexttoward(3) Guardian Native C Library Calls Reference Manual
NAME
nexttoward - Computes the next representable floating-point number
LIBRARY
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 nexttoward(
double x,
long double y
);
PARAMETERS
x Is a double number.
y Is a long double number.
DESCRIPTION
The nexttoward() function is equivalent to the nextafter() function (which calculates the next
representable floating-point value following the value of the x parameter in the direction of the y
parameter), except that the y parameter is type long double and the nexttoward() function
returns y converted to the type of the function if x equals y.
NOTES
This function is implemented only for the IEEE_float oating-point option. Applications using
this function cannot be compiled if the specified floating-point option is Tandem_float.
RETURN VALUES
Upon successful completion, the nexttoward() function returns the next representable floating-
point value following the value of the x parameter in the direction of the y parameter.
If x equals y, the function returns y converted to the type of x.
If x or y equals NaN, the function returns NaN.
If x is finite but the correct function value would cause overow, the function returns positive or
negative HUGE_VAL (with the same sign as x) and sets errno to [ERANGE].
If x! equals y and the correct function value is subnormal, zero, or underflows, the function
returns either the correct function value (if representable) or 0.0, and sets errno to [ERANGE].
ERRORS
If any of the following conditions occurs, the nexttoward() function sets errno to the
corresponding value:
[ERANGE] One of the following conditions occurred:
The return value would cause an overow.
The return value is subnormal or would cause an underow.
RELATED INFORMATION
Functions: nextafter(3), nexttowardf(3), nexttowardl(3).
Files: math(4).
514 Hewlett-Packard Company 527192-018