function
<cmath> <ctgmath>
expm1double expm1 (double x); float expm1f (float x);long double expm1l (long double x);
double expm1 (double x); float expm1 (float x);long double expm1 (long double x); double expm1 (T x); // additional overloads for integral types
Compute exponential minus one
Returns e raised to the power x minus one:ex-1
.
For small magnitude values of x, expm1 may be more accurate than exp(x)-1
.
Header
<tgmath.h>provides a type-generic macro version of this function.
are provided in this header (
<cmath>
) for the
integral types: These overloads effectively cast
xto a
double
before calculations (defined for
Tbeing any
integral type).
If an overflow range error occurs:
1
2
3
4
5
6
7
8
9
10
11
12
/* expm1 example */
#include <stdio.h> /* printf */
#include <math.h> /* expm1 */
int main ()
{
double param, result;
param = 1.0;
result = expm1 (param);
printf ("expm1 (%f) = %f.\n", param, result );
return 0;
}
expm1 (1.000000) = 1.718282.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4