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 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
27 .\" Modified 2002-07-27 Walter Harms
28 .\" (walter.harms@informatik.uni-oldenburg.de)
30 .TH EXPM1 3 2021-03-22 "" "Linux Programmer's Manual"
32 expm1, expm1f, expm1l \- exponential minus 1
37 .BI "double expm1(double " x );
38 .BI "float expm1f(float " x );
39 .BI "long double expm1l(long double " x );
45 Feature Test Macro Requirements for glibc (see
46 .BR feature_test_macros (7)):
51 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
52 || _XOPEN_SOURCE >= 500
53 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
54 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
55 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
61 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
62 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
63 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
66 These functions return a value equivalent to
72 The result is computed in a way that is accurate even if the value of
77 would be inaccurate due to
78 subtraction of two numbers that are nearly equal.
80 On success, these functions return
95 is positive infinity, positive infinity is returned.
99 is negative infinity, \-1 is returned.
101 If the result overflows, a range error occurs,
102 and the functions return
111 for information on how to determine whether an error has occurred
112 when calling these functions.
114 The following errors can occur:
116 Range error, overflow
121 An overflow floating-point exception
125 .\" POSIX.1 specifies an optional range error (underflow) if
126 .\" x is subnormal. Glibc does not implement this.
128 For an explanation of the terms used in this section, see
136 Interface Attribute Value
141 T} Thread safety MT-Safe
147 C99, POSIX.1-2001, POSIX.1-2008.
151 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778
152 on certain architectures (e.g., x86, but not x86_64)
154 raised a bogus underflow floating-point exception
155 for some large negative
157 values (where the function result approaches \-1).
159 Before approximately glibc version 2.11,
160 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6814
161 .\" e.g., expm1(1e5) through expm1(1.00199970127e5),
162 .\" but not expm1(1.00199970128e5) and beyond.
164 raised a bogus invalid floating-point exception in addition to the expected
165 overflow exception, and returned a NaN instead of positive infinity,
166 for some large positive
171 .\" It looks like the fix was in 2.11, or possibly 2.12.
172 .\" I have no test system for 2.11, but 2.12 passes.
173 .\" From the source (sysdeps/i386/fpu/s_expm1.S) it looks
174 .\" like the changes were in 2.11.
175 the glibc implementation did not set
176 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788
180 when a range error occurred.