manipulate(3C)manipulate(3C)NAME
nextafter, nexttoward, nextafterf, nexttowardf, nextafterl, nexttowardl -
manipulation functions (libc routines)
SYNOPSIS
#include <math.h>
double nextafter (double x, double y);
float nextafterf (float x, float y);
long double nextafterl (long double x, long double y);
double nexttoward (double x, long double y);
float nexttowardf (float x, long double y);
long double nexttowardl (long double x, long double y);
DESCRIPTION
Of the above named functions, only nextafter is available for programs
compiled with the O32 ABI.
Note that the long double routines are only valid for the MIPSpro
compilers.
nextafter returns the next representable double-precision floating-point
value following x in the direction of y. Thus, if y is less than x,
nextafter returns the largest representable floating-point number less
than x. nextafterf and nextafterl are the float and long double
analogues of nextafter.
The nexttoward functions are equivalent to the nextafter functions except
that the second parameter has type long double and the functions return y
converted to the type of the function if x equals y.
NOTES
Long double operations on this system are only supported in round to
nearest rounding mode (the default). The system must be in round to
nearest rounding mode when calling any of the long double functions, or
incorrect answers will result.
SEE ALSOcc(1), intro(3M).
DIAGNOSTICS
If input x to nextafter is positive or negative infinity, that input is
returned and errno is set to EDOM. (Similarly for nextafterf and
nextafterl). The overflow and inexact exceptions are signalled when
input x is finite, but nextafter(x, y) is not. (Similarly for nextafterf
and nextafterl). The underflow and inexact exceptions are signalled when
nextafter(x, y) lies strictly between _2**-1022. In these cases errno is
Page 1
manipulate(3C)manipulate(3C)
also set to ERANGE.
The corresponding values for nextafterf and nextafterl are _2**-126 and
_2**-916, respectively.
Page 2