nextafter.3m (2010 09)

n
nextafter(3M) nextafter(3M)
NAME
nextafter( ), nextafterf( ), nextafterl( ), nextafterw( ), nextafterq( ), nexttoward( ), nexttowardf( ),
nexttowardl( ), nexttowardw( ), nexttowardq( ) - next representable floating-point values
SYNOPSIS
#include <math.h>
double nextafter(double x, double y);
float nextafterf(float x, float y);
HP Integrity Server Only
long double nextafterl(long double x, long double y);
extended nextafterw(extended x, extended y);
quad nextafterq(quad x, quad y);
double nexttoward(double x, long double y);
float nexttowardf(float x, long double y);
long double nexttowardl(long double x, long double y);
extended nexttowardw(extended x, long double y);
quad nexttowardq(quad x, long double y);
DESCRIPTION
The nextafter() function computes the next representable double-precision 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 .
The
nextafter() function returns y if x equals y .
The
nexttoward() function is equivalent to nextafter() except that the second parameter has type
long double and the function returns y converted to the type of the function if x equals y .
The result of the
nexttoward() function is determined in the type of the function, without loss of
range or precision in a floating second argument, whose type may be wider than the type of the function.
nextafterf() is a float versions of nextafter(); it takes float arguments and returns a
float result.
nextafterl() is a long double version of nextafter(); it takes long double arguments
and returns a long double result.
nextafterw() is an extended version of nextafter(); it takes extended arguments and returns
an extended result.
nextafterq() is equivalent to nextafterl() on HP-UX systems.
nexttowardf() is a float versions of nexttoward(); it takes a float first argument and returns
a float result.
nexttowardl() is equivalent to nextafterl().
nexttowardw() is an extended version of nexttoward(); it takes an extended first argument
and returns an extended result.
nexttowardq() is equivalent to nexttowardl() on HP-UX systems.
USAGE
To use these functions, compile either with the default
-Ae option or with the -Aa and
-D_HPUX_SOURCE options.
To use (for Integrity servers)
nextafterw(), nextafterq(), nexttowardw(),or
nexttowardq(), compile also with the -fpwidetypes option.
Make sure your program includes
<math.h>. Link in the math library by specifying -lm on the com-
piler or linker command line.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)