Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Mathematical Library Functionsexpm1(3M)


NAME

 expm1 - computes exponential functions

SYNOPSIS

 
cc [ flag ... ] file ... -lm [ library ... ]
#include <math.h>
double expm1(double x);

DESCRIPTION

 

The expm1() function computes ex-1.0.

RETURN VALUES

 

If x is NaN, then the function returns NaN.

If x is positive infinity, expm1() returns positive infinity.

If x is negative infinity, expm1() returns -1.0.

If the value overflows, expm1() returns HUGE_VAL.

ERRORS

 

No errors will occur.

USAGE

 

The value of expm1(x) may be more accurate than exp(x)-1.0 for small values of x.

The expm1() and log1p(3M) functions are useful for financial calculations of ((1+x)n-1)/x, namely:

 
expm1(n * log1p(x))/x

when x is very small (for example, when performing calculations with a small daily interest rate). These functions also simplify writing accurate inverse hyperbolic functions.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

exp(3M), ilogb(3M), log1p(3M), attributes(5)


SunOS 5.9Go To TopLast Changed 29 Dec 1996

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.