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 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
21 || _XOPEN_SOURCE >= 500
22 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24 expm1f(), expm1l():
25 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
26 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
27 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
28
30 These functions return a value equivalent to
31
32 exp(x) - 1
33
34 The result is computed in a way that is accurate even if the value of x
35 is near zero—a case where exp(x) - 1 would be inaccurate due to sub‐
36 traction of 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 For an explanation of the terms used in this section, see
64 attributes(7).
65
66 ┌────────────────────────────┬───────────────┬─────────┐
67 │Interface │ Attribute │ Value │
68 ├────────────────────────────┼───────────────┼─────────┤
69 │expm1(), expm1f(), expm1l() │ Thread safety │ MT-Safe │
70 └────────────────────────────┴───────────────┴─────────┘
72 C99, POSIX.1-2001, POSIX.1-2008.
73
75 Before glibc 2.17, on certain architectures (e.g., x86, but not x86_64)
76 expm1() raised a bogus underflow floating-point exception for some
77 large negative x values (where the function result approaches -1),
78
79 Before approximately glibc version 2.11, expm1() raised a bogus invalid
80 floating-point exception in addition to the expected overflow excep‐
81 tion, and returned a NaN instead of positive infinity. for some large
82 positive x values,
83
84 Before version 2.11, the glibc implementation did not set errno to
85 ERANGE when a range error occurred.
86
88 exp(3), log(3), log1p(3)
89
91 This page is part of release 5.07 of the Linux man-pages project. A
92 description of the project, information about reporting bugs, and the
93 latest version of this page, can be found at
94 https://www.kernel.org/doc/man-pages/.
95
96
97
98 2020-06-09 EXPM1(3)