United States-English |
|
|
HP-UX Reference > Eexpm1(3M)HP-UX 11i Version 3: February 2007 |
|
NAMEexpm1(), expm1f(), expm1l(), expm1w(), expm1q() — exponential minus 1 functions DESCRIPTIONThe expm1() function is equivalent to exp(x) - 1, but may be more accurate for very small values of x. The expm1() and log1p() functions are useful to guarantee that financial calculations of (((1+x)**n)-1)/x are accurate when x is very small, namely: expm1(n * log1p(x))/x The preceding example might be applicable when calculating small daily interest rates. See also annuity(). Integrity Server Onlyexpm1f() is a float version of expm1(); it takes a float argument and returns a float result. expm1l() is a long double version of expm1(); it takes a long double argument and returns a long double result. expm1w() is an extended version of expm1(); it takes an extended argument and returns an extended result. expm1q() is equivalent to expm1l() on HP-UX systems. USAGETo use these functions, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options. To use (for Integrity servers) expm1w() or expm1q(), compile also with the -fpwidetypes option. Make sure your program includes <math.h>, and link in the math library by specifying -lm on the compiler or linker 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 VALUEexpm1(±0) returns ±0. If x is +INFINITY, expm1() returns +INFINITY. If x is -INFINITY, expm1() returns -1.0. If x is NaN, expm1() returns NaN. expm1() returns infinity (equal to HUGE_VAL) in lieu of a value whose magnitude is too large, and raises the overflow and inexact exceptions. When it raises no other exception, whether expm1() raises the inexact exception is unspecified. |
Printable version | ||
|