1EXPM1(3) Linux Programmer's Manual EXPM1(3)
2
3
4
6 expm1, expm1f, expm1l - exponential minus 1
7
9 #include <math.h>
10
11 double expm1(double x);
12 float expm1f(float x);
13 long double expm1l(long double x);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 expm1():
20 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 ||
21 _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE ||
22 _POSIX_C_SOURCE >= 200112L;
23 or cc -std=c99
24 expm1f(), expm1l():
25 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
26 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
27 or cc -std=c99
28
30 expm1(x) returns a value equivalent to
31
32 exp(x) - 1
33
34 It is computed in a way that is accurate even if the value of x is near
35 zero—a case where exp(x) - 1 would be inaccurate due to subtraction of
36 two numbers that are nearly equal.
37
39 On success, these functions return exp(x) - 1.
40
41 If x is a NaN, a NaN is returned.
42
43 If x is +0 (-0), +0 (-0) is returned.
44
45 If x is positive infinity, positive infinity is returned.
46
47 If x is negative infinity, -1 is returned.
48
49 If the result overflows, a range error occurs, and the functions return
50 -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively.
51
53 See math_error(7) for information on how to determine whether an error
54 has occurred when calling these functions.
55
56 The following errors can occur:
57
58 Range error, overflow
59 errno is set to ERANGE (but see BUGS). An overflow floating-
60 point exception (FE_OVERFLOW) is raised.
61
63 C99, POSIX.1-2001.
64
66 For some large negative x values (where the function result approaches
67 -1), expm1() raises a bogus underflow floating-point exception.
68
69 For some large positive x values, expm1() raises a bogus invalid float‐
70 ing-point exception in addition to the expected overflow exception, and
71 returns a NaN instead of positive infinity.
72
73 Before version 2.11, the glibc implementation did not set errno to
74 ERANGE when a range error occurred.
75
77 exp(3), log(3), log1p(3)
78
80 This page is part of release 3.53 of the Linux man-pages project. A
81 description of the project, and information about reporting bugs, can
82 be found at http://www.kernel.org/doc/man-pages/.
83
84
85
86 2010-09-12 EXPM1(3)