]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/expm1.3
CPU_SET.3, INFINITY.3, __ppc_get_timebase.3, __ppc_set_ppr_med.3, __ppc_yield.3,...
[thirdparty/man-pages.git] / man3 / expm1.3
CommitLineData
fea681da 1.\" Copyright 1995 Jim Van Zandt <jrv@vanzandt.mv.com>
77c9946a
MK
2.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3.\" <mtk.manpages@gmail.com>
fea681da 4.\"
93015253 5.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
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.
9.\"
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.
c13182ef 14.\"
fea681da
MK
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
21.\" professionally.
c13182ef 22.\"
fea681da
MK
23.\" Formatted or processed versions of this manual, if unaccompanied by
24.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 25.\" %%%LICENSE_END
fea681da
MK
26.\"
27.\" Modified 2002-07-27 Walter Harms
28.\" (walter.harms@informatik.uni-oldenburg.de)
29.\"
97986708 30.TH EXPM1 3 2016-03-15 "" "Linux Programmer's Manual"
fea681da 31.SH NAME
77c9946a 32expm1, expm1f, expm1l \- exponential minus 1
fea681da
MK
33.SH SYNOPSIS
34.nf
35.B #include <math.h>
68e4db0a 36.PP
fea681da 37.BI "double expm1(double " x );
d39541ec 38.br
fea681da 39.BI "float expm1f(float " x );
d39541ec 40.br
fea681da 41.BI "long double expm1l(long double " x );
68e4db0a 42.PP
fea681da 43.fi
20c58d70 44Link with \fI\-lm\fP.
68e4db0a 45.PP
cc4615cc
MK
46.in -4n
47Feature Test Macro Requirements for glibc (see
48.BR feature_test_macros (7)):
49.in
68e4db0a 50.PP
cc4615cc 51.ad l
77c9946a 52.BR expm1 ():
810e18c2 53.RS 4
636ed4d5
MK
54_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
55 || _XOPEN_SOURCE\ >=\ 500
cf7fa0a1 56.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
636ed4d5
MK
57 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
58 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
810e18c2 59.RE
77c9946a 60.br
cc4615cc
MK
61.BR expm1f (),
62.BR expm1l ():
810e18c2 63.RS 4
636ed4d5
MK
64_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
65 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
66 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
810e18c2 67.RE
cc4615cc 68.ad b
fea681da 69.SH DESCRIPTION
5600f73a 70These functions return a value equivalent to
8937ead2
MK
71.nf
72
73 exp(x) \- 1
74
75.fi
5600f73a 76The result is computed in a way that is accurate even if the value of
022671eb
MK
77.I x
78is near
8937ead2
MK
79zero\(ema case where
80.I "exp(x) \- 1"
81would be inaccurate due to
fea681da 82subtraction of two numbers that are nearly equal.
77c9946a
MK
83.SH RETURN VALUE
84On success, these functions return
85.IR "exp(x)\ \-\ 1" .
847e0d88 86.PP
77c9946a
MK
87If
88.I x
89is a NaN,
90a NaN is returned.
847e0d88 91.PP
77c9946a
MK
92If
93.I x
94is +0 (\-0),
95+0 (\-0) is returned.
847e0d88 96.PP
77c9946a
MK
97If
98.I x
99is positive infinity, positive infinity is returned.
847e0d88 100.PP
77c9946a
MK
101If
102.I x
103is negative infinity, \-1 is returned.
847e0d88 104.PP
efe294cb 105If the result overflows, a range error occurs,
77c9946a
MK
106and the functions return
107.RB - HUGE_VAL ,
108.RB - HUGE_VALF ,
109or
110.RB - HUGE_VALL ,
111respectively.
112.SH ERRORS
113See
114.BR math_error (7)
115for information on how to determine whether an error has occurred
116when calling these functions.
117.PP
118The following errors can occur:
119.TP
120Range error, overflow
12fd9351
MK
121.I errno
122is set to
123.BR ERANGE
124(but see BUGS).
77c9946a
MK
125An overflow floating-point exception
126.RB ( FE_OVERFLOW )
127is raised.
77c9946a
MK
128.\"
129.\" POSIX.1 specifies an optional range error (underflow) if
130.\" x is subnormal. Glibc does not implement this.
a2f0602b 131.SH ATTRIBUTES
f0908802
MK
132For an explanation of the terms used in this section, see
133.BR attributes (7).
134.TS
135allbox;
136lbw27 lb lb
137l l l.
138Interface Attribute Value
139T{
a2f0602b
PH
140.BR expm1 (),
141.BR expm1f (),
a2f0602b 142.BR expm1l ()
f0908802
MK
143T} Thread safety MT-Safe
144.TE
47297adb 145.SH CONFORMING TO
9a74e018 146C99, POSIX.1-2001, POSIX.1-2008.
77c9946a
MK
147.\" BSD.
148.SH BUGS
149For some large negative
150.I x
19dffabe 151values (where the function result approaches \-1),
77c9946a 152.BR expm1 ()
0b9fe528 153raises a bogus underflow floating-point exception.
19dffabe 154.\" FIXME .
77c9946a 155.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778
847e0d88 156.PP
19dffabe
MK
157For some large positive
158.I x
159values,
160.BR expm1 ()
0b9fe528 161raises a bogus invalid floating-point exception in addition to the expected
19dffabe
MK
162overflow exception, and returns a NaN instead of positive infinity.
163.\" FIXME .
164.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6814
165.\" e.g., expm1(1e5) through expm1(1.00199970127e5),
166.\" but not expm1(1.00199970128e5) and beyond.
847e0d88 167.PP
12fd9351
MK
168Before version 2.11,
169.\" It looks like the fix was in 2.11, or possibly 2.12.
170.\" I have no test system for 2.11, but 2.12 passes.
171.\" From the source (sysdeps/i386/fpu/s_expm1.S) it looks
172.\" like the changes were in 2.11.
173the glibc implementation did not set
174.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788
175.I errno
176to
177.B ERANGE
178when a range error occurred.
47297adb 179.SH SEE ALSO
fea681da
MK
180.BR exp (3),
181.BR log (3),
182.BR log1p (3)