1 .\" Copyright 1995 Jim Van Zandt <jrv@vanzandt.mv.com>
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" Modified 2002-07-27 Walter Harms
8 .\" (walter.harms@informatik.uni-oldenburg.de)
10 .TH EXPM1 3 2021-03-22 GNU "Linux Programmer's Manual"
12 expm1, expm1f, expm1l \- exponential minus 1
15 .RI ( libm ", " \-lm )
20 .BI "double expm1(double " x );
21 .BI "float expm1f(float " x );
22 .BI "long double expm1l(long double " x );
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
32 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
33 || _XOPEN_SOURCE >= 500
34 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
35 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
36 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
42 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
43 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
44 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
47 These functions return a value equivalent to
53 The result is computed in a way that is accurate even if the value of
58 would be inaccurate due to
59 subtraction of two numbers that are nearly equal.
61 On success, these functions return
76 is positive infinity, positive infinity is returned.
80 is negative infinity, \-1 is returned.
82 If the result overflows, a range error occurs,
83 and the functions return
92 for information on how to determine whether an error has occurred
93 when calling these functions.
95 The following errors can occur:
102 An overflow floating-point exception
106 .\" POSIX.1 specifies an optional range error (underflow) if
107 .\" x is subnormal. Glibc does not implement this.
109 For an explanation of the terms used in this section, see
117 Interface Attribute Value
122 T} Thread safety MT-Safe
128 C99, POSIX.1-2001, POSIX.1-2008.
132 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778
133 on certain architectures (e.g., x86, but not x86_64)
135 raised a bogus underflow floating-point exception
136 for some large negative
138 values (where the function result approaches \-1).
140 Before approximately glibc version 2.11,
141 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6814
142 .\" e.g., expm1(1e5) through expm1(1.00199970127e5),
143 .\" but not expm1(1.00199970128e5) and beyond.
145 raised a bogus invalid floating-point exception in addition to the expected
146 overflow exception, and returned a NaN instead of positive infinity,
147 for some large positive
152 .\" It looks like the fix was in 2.11, or possibly 2.12.
153 .\" I have no test system for 2.11, but 2.12 passes.
154 .\" From the source (sysdeps/i386/fpu/s_expm1.S) it looks
155 .\" like the changes were in 2.11.
156 the glibc implementation did not set
157 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788
161 when a range error occurred.