2 .\" Copyright 1995 Jim Van Zandt <jrv@vanzandt.mv.com>
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\" <mtk.manpages@gmail.com>
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .\" Modified 2002-07-27 Walter Harms
9 .\" (walter.harms@informatik.uni-oldenburg.de)
11 .TH expm1 3 (date) "Linux man-pages (unreleased)"
13 expm1, expm1f, expm1l \- exponential minus 1
16 .RI ( libm ", " \-lm )
21 .BI "double expm1(double " x );
22 .BI "float expm1f(float " x );
23 .BI "long double expm1l(long double " x );
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
33 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
34 || _XOPEN_SOURCE >= 500
35 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
36 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
37 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
43 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
44 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
45 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
48 These functions return a value equivalent to
54 The result is computed in a way that is accurate even if the value of
59 would be inaccurate due to
60 subtraction of two numbers that are nearly equal.
62 On success, these functions return
77 is positive infinity, positive infinity is returned.
81 is negative infinity, \-1 is returned.
83 If the result overflows, a range error occurs,
84 and the functions return
93 for information on how to determine whether an error has occurred
94 when calling these functions.
96 The following errors can occur:
103 An overflow floating-point exception
107 .\" POSIX.1 specifies an optional range error (underflow) if
108 .\" x is subnormal. glibc does not implement this.
110 For an explanation of the terms used in this section, see
116 Interface Attribute Value
123 T} Thread safety MT-Safe
133 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6778
134 on certain architectures (e.g., x86, but not x86_64)
136 raised a bogus underflow floating-point exception
137 for some large negative
139 values (where the function result approaches \-1).
141 Before approximately glibc 2.11,
142 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6814
143 .\" e.g., expm1(1e5) through expm1(1.00199970127e5),
144 .\" but not expm1(1.00199970128e5) and beyond.
146 raised a bogus invalid floating-point exception in addition to the expected
147 overflow exception, and returned a NaN instead of positive infinity,
148 for some large positive
153 .\" It looks like the fix was in glibc 2.11, or possibly glibc 2.12.
154 .\" I have no test system for glibc 2.11, but glibc 2.12 passes.
155 .\" From the source (sysdeps/i386/fpu/s_expm1.S) it looks
156 .\" like the changes were in glibc 2.11.
157 the glibc implementation did not set
158 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6788
162 when a range error occurred.