nearbyintd64.3m (2010 09)

n
nearbyintd64(3M) nearbyintd64(3M)
(HP Integrity Server Only)
NAME
nearbyintd64(), nearbyintd128(), nearbyintd32() - decimal round to nearest integer functions
SYNOPSIS
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal64 nearbyintd64(_Decimal64 x);
_Decimal128 nearbyintd128(_Decimal128 x);
_Decimal32 nearbyintd32(_Decimal32 x);
DESCRIPTION
nearbyintd64()
returns the integer (represented as a _Decimal64 number) nearest x according to
the current (decimal) rounding direction mode.
In the default rounding direction (round to nearest with ties to even),
nearbyintd64(
x) is the integer
nearest x with the additional stipulation that if |
nearbyintd64(x) x|=1/2, then
nearbyintd64(
x) is even.
If the current rounding direction is toward negative infinity,
nearbyintd64()
returns the same value
as
floord64(). If the current rounding direction is toward positive infinity, nearbyintd64()
returns the same value as ceild64(). If the current rounding direction is toward zero, nearby-
intd64() returns the same value as truncd64(). If the current rounding direction is to nearest with
ties awary from zero, nearbyintd64()
returns the same value as roundd64().
nearbyintd64() differs from
rintd64() only in that rintd64() raises the inexact exception if
the result differs in value from the argument, while
nearbyintd64()
does not.
nearbyintd128() is a
_Decimal128 version of nearbyintd64(); it takes a _Decimal128 argu-
ment and returns a
_Decimal128 result.
nearbyintd32() is a _Decimal32
version of nearbyintd64(); it takes a _Decimal32 argument
and returns a
_Decimal32
These math functions are supported for HP-UX 11i Version 3 September 2008 Update and forward.
result.
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 is ±infinity or ±0,
nearbyintd64() returns x.
If x is NaN,
nearbyintd64() returns NaN.
ERRORS
No errors are defined.
SEE ALSO
ceild64(3M), fabsd64(3M), fe_dec_getround(3M), fe_dec_setround(3M), floord64(3M), fmodd64(3M),
rintd64(3M), roundd64(3M), truncd64(3M), math(5).
STANDARDS CONFORMANCE
These functions conform to ISO/IEC TR 24732, "Extension for the programming language C to support
decimal floating-point arithmetic".
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)