log1pd64.3m (2010 09)

l
log1pd64(3M) log1pd64(3M)
(HP Integrity Server Only)
NAME
log1pd64(), log1pd128(), log1pd32() - decimal natural logarithm of one-plus-argument functions
SYNOPSIS
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal64 log1pd64(_Decimal64 x);
_Decimal128 log1pd128(_Decimal128 x);
_Decimal32 log1pd32(_Decimal32 x);
DESCRIPTION
The log1pd64() function computes the logarithmic function logd64(1 +
x), but may be more accu-
rate for very small values of x.
The
expm1d64() and log1pd64() functions are useful to guarantee that financial calculations of
(((1+x)**n)-1)/x are accurate when x is very small, namely:
expm1d64(n * log1pd64(x))/x
The preceding example might be applicable when calculating small daily interest rates.
log1pd128() is a _Decimal128 version of log1pd64(); it takes a _Decimal128 argument and
returns a _Decimal128 result.
log1pd32() is a _Decimal32 version of log1pd64(); it takes a _Decimal32 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 is +infinity,
log1pd64() returns +infinity.
If x is -1,
log1pd64() returns infinity and raises the divide-by-zero exception.
If x is less than -1,
log1pd64() returns NaN and raises the invalid exception.
If x is NaN,
log1pd64() returns NaN.
log1pd64() raises the inexact exception whenever a rounded result does not equal the mathematical
result.
ERRORS
If x is less than -1,
log1pd64() sets errno to [EDOM].
If x is -1,
log1pd64() sets errno to [ERANGE].
SEE ALSO
annuity(3M), compound(3M), expm1d64(3M), log10d64(3M), log2d64(3M), logd64(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)