Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
nexttowardf(3) Guardian Native C Library Calls Reference Manual
NAME
nexttowardf - Computes the next representable float 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>
float nexttowardf(
float x,
long double y
);
PARAMETERS
x Is a float number.
y Is a long double number.
DESCRIPTION
The nexttowardf() function is a float version of the nexttoward() function; it takes a float argu-
ment and returns a float result.
The nexttowardf() function is equivalent to the nextafterf() 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 nexttowardf() function
returns y converted to the type of the function if x equals y.
NOTES
This function is implemented only for the IEEE_float floating-point option. Applications using
this function cannot be compiled if the specified floating-point option is Tandem_float.
RETURN VALUES
Upon successful completion, the nexttowardf() 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 overflow, the function returns positive or
negative HUGE_VALF (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 nexttowardf() function sets errno to the
corresponding value:
[ERANGE] One of the following conditions occurred:
• The return value would cause an overflow.
• The return value is subnormal or would cause an underflow.
5−16 Hewlett-Packard Company 527192-018