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

Table of contents


NAME

nexttowardf, nexttoward, nexttowardl, nexttowardw, nexttowardq, nexttowardll, nexttowarddf, nexttowardd, nexttowarddl, nexttowarddll - find next representable floating-point number

SYNOPSIS

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

#include <mathcw.h>

extern float nexttowardf (float x, long double y);

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

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

extern __float80 nexttowardw (__float80 x, long double y);

extern __float128 nexttowardq (__float128 x, long double y);

extern long_long_double nexttowardll (long_long_double x, long_long_double y);

extern decimal_float nexttowarddf (decimal_float x, decimal_long_double y);

extern decimal_double nexttowardd (decimal_double x, decimal_long_double y);

extern decimal_long_double nexttowarddl (decimal_long_double x, decimal_long_double y);

extern decimal_long_long_double nexttowarddll (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.

This function is equivalent to the nextafter(x,y) function, except for the type of the second argument.


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), nextafter(3CW), ulpk(3CW), ulpmh(3CW).