nextafterd64.3m (2010 09)

n
nextafterd64(3M) nextafterd64(3M)
(HP Integrity Server Only)
NAME
nextafterd64(), nextafterd128(), nextafterd32(), nexttowardd64(), nexttowardd128(), nexttowardd32() -
next representable decimal floating-point numbers
SYNOPSIS
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal64 nextafterd64(_Decimal64 x, _Decimal64 y);
_Decimal128 nextafterd128(_Decimal128 x, _Decimal128 y);
_Decimal32 nextafterd32(_Decimal32 x, _Decimal32 y);
_Decimal64 nexttowardd64(_Decimal64 x, _Decimal128 y);
_Decimal128 nexttowardd128(_Decimal128 x, _Decimal128 y);
_Decimal32 nexttowardd32(_Decimal32 x, _Decimal128 y);
DESCRIPTION
The nextafterd64()
function computes the next representable
_Decimal64 number following x in
the direction toward y. Thus, if y is less than x,
nextafterd64()
returns the largest representable
_Decimal64 number less than x.
The
nextafterd64() function returns y if x equals y.
The
nexttowardd64()
function is equivalent to nextafterd64() except that the second parameter
has the widest decimal floating-point type,
_Decimal128, and the function returns y converted to the
type of the function if x equals y.
The result of the
nexttowardd64()
function is determined in the type of the function, without loss of
range or precision in a oating second argument, whose type may be wider than the type of the function.
nextafterd128() is a
_Decimal128 version of nextafterd64(); it takes _Decimal128 argu-
ments and returns a
_Decimal128 result.
nextafterd32() is a
_Decimal32 version of nextafterd64(); it takes _Decimal32 arguments
and returns a
_Decimal32 result.
nexttowardd128()
is a _Decimal128 version of nexttowardd64(); it takes a _Decimal128
first argument and returns a _Decimal128 result.
nexttowardd32() is a
_Decimal32 version of nexttowardd64(); it takes a _Decimal32 first
argument and returns a
_Decimal32 result.
These math functions are supported for HP-UX 11i Version 3 September 2008 Update and forward.
USAGE
To use any of these functions, compile with the
+decfp option.
Make sure your program defines
__STDC_WANT_DEC_FP__ and then includes <math.h>.
Link in the math library by specifying
-lm or -l:libm.a on the linking command line.
For more information, see the HP-UX floating-point guide for HP Integrity servers at the following site:
http://www.hp.com/go/fp.
RETURN VALUE
If x equals y,
nextafterd64() returns y, and nexttowardd64()
returns y converted to the type of
x.
If x is finite and the correct function value would overflow, these functions return ±infinity according to
the sign of x, and raise the overflow and inexact floating-point exceptions.
If the return value is subnormal and x!=y, these functions raise the underflow and inexact floating-point
exceptions.
If x or y is NaN, these functions return NaN.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)