NEXTAFTER 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

nextafterf, nextafter, nextafterl, nextafterw, nextafterq, nextafterll, nextafterdf, nextafterd, nextafterdl, nextafterdll - next representable floating-point number

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float nextafterf (float x, float y);

extern double nextafter (double x, double y);

extern long double nextafterl (long double x, long double y);

extern __float80 nextafterw (__float80 x, __float80 y);

extern __float128 nextafterq (__float128 x, __float128 y);

extern long_long_double nextafterll (long_long_double x, long_long_double y);

extern decimal_float nextafterdf (decimal_float x, decimal_float y);

extern decimal_double nextafterd (decimal_double x, decimal_double y);

extern decimal_long_double nextafterdl (decimal_long_double x, decimal_long_double y);

extern decimal_long_long_double nextafterdll (decimal_long_long_double x, decimal_long_long_double y);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the next representable value after x in the direction of y. If x == y, the result is y.

RETURN VALUES

Return the next representable value after the first argument in the direction of the second argument.

If either argument is a NaN, that argument is returned.

If the first argument is +Infinity or -Infinity and the second argument is finite or an infinity of the opposite sign of the first argument, the value returned is the nearest largest-magnitude representable floating-point number.

If the first argument is -0 or +0, and the second argument is nonzero, the value returned is the smallest-magnitude representable floating-point number with the sign of the second argument; the value is subnormal if subnormals are supported, and otherwise, normal.


ERRORS

In IEEE 754 and 854 arithmetic, the invalid or overflow exception flags may be set, but errno is never set.

SEE ALSO

mcheps(3CW), nexttoward(3CW), ulpk(3CW), ulpmh(3CW).