]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/expm1.3
acos.3, acosh.3, asin.3, asinh.3, atan.3, atan2.3, atanh.3, cabs.3, cacos.3, cacosh...
[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.\"
fe0fefbf 30.TH EXPM1 3 2015-03-02 "" "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>
36.sp
37.BI "double expm1(double " x );
d39541ec 38.br
fea681da 39.BI "float expm1f(float " x );
d39541ec 40.br
fea681da
MK
41.BI "long double expm1l(long double " x );
42.sp
43.fi
20c58d70 44Link with \fI\-lm\fP.
cc4615cc
MK
45.sp
46.in -4n
47Feature Test Macro Requirements for glibc (see
48.BR feature_test_macros (7)):
49.in
50.sp
51.ad l
77c9946a 52.BR expm1 ():
810e18c2
MK
53.RS 4
54_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
55_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE ||
98dbe7af 56_POSIX_C_SOURCE\ >=\ 200112L;
810e18c2
MK
57.br
58or
77c9946a 59.I cc\ -std=c99
810e18c2 60.RE
77c9946a 61.br
cc4615cc
MK
62.BR expm1f (),
63.BR expm1l ():
810e18c2
MK
64.RS 4
65_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
98dbe7af 66_POSIX_C_SOURCE\ >=\ 200112L;
810e18c2
MK
67.br
68or
cc4615cc 69.I cc\ -std=c99
810e18c2 70.RE
cc4615cc 71.ad b
fea681da 72.SH DESCRIPTION
5600f73a 73These functions return a value equivalent to
8937ead2
MK
74.nf
75
76 exp(x) \- 1
77
78.fi
5600f73a 79The result is computed in a way that is accurate even if the value of
022671eb
MK
80.I x
81is near
8937ead2
MK
82zero\(ema case where
83.I "exp(x) \- 1"
84would be inaccurate due to
fea681da 85subtraction of two numbers that are nearly equal.
77c9946a
MK
86.SH RETURN VALUE
87On success, these functions return
88.IR "exp(x)\ \-\ 1" .
89
90If
91.I x
92is a NaN,
93a NaN is returned.
94
95If
96.I x
97is +0 (\-0),
98+0 (\-0) is returned.
99
100If
101.I x
102is positive infinity, positive infinity is returned.
103
104If
105.I x
106is negative infinity, \-1 is returned.
107
efe294cb 108If the result overflows, a range error occurs,
77c9946a
MK
109and the functions return
110.RB - HUGE_VAL ,
111.RB - HUGE_VALF ,
112or
113.RB - HUGE_VALL ,
114respectively.
115.SH ERRORS
116See
117.BR math_error (7)
118for information on how to determine whether an error has occurred
119when calling these functions.
120.PP
121The following errors can occur:
122.TP
123Range error, overflow
12fd9351
MK
124.I errno
125is set to
126.BR ERANGE
127(but see BUGS).
77c9946a
MK
128An overflow floating-point exception
129.RB ( FE_OVERFLOW )
130is raised.
77c9946a
MK
131.\"
132.\" POSIX.1 specifies an optional range error (underflow) if
133.\" x is subnormal. Glibc does not implement this.
a2f0602b 134.SH ATTRIBUTES
f0908802
MK
135For an explanation of the terms used in this section, see
136.BR attributes (7).
137.TS
138allbox;
139lbw27 lb lb
140l l l.
141Interface Attribute Value
142T{
a2f0602b
PH
143.BR expm1 (),
144.BR expm1f (),
a2f0602b 145.BR expm1l ()
f0908802
MK
146T} Thread safety MT-Safe
147.TE
47297adb 148.SH CONFORMING TO
9a74e018 149C99, POSIX.1-2001, POSIX.1-2008.
77c9946a
MK
150.\" BSD.
151.SH BUGS
152For some large negative
153.I x
19dffabe 154values (where the function result approaches \-1),
77c9946a 155.BR expm1 ()
0b9fe528 156raises a bogus underflow floating-point exception.
19dffabe 157.\" FIXME .
77c9946a 158.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778
19dffabe
MK
159
160For some large positive
161.I x
162values,
163.BR expm1 ()
0b9fe528 164raises a bogus invalid floating-point exception in addition to the expected
19dffabe
MK
165overflow exception, and returns a NaN instead of positive infinity.
166.\" FIXME .
167.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6814
168.\" e.g., expm1(1e5) through expm1(1.00199970127e5),
169.\" but not expm1(1.00199970128e5) and beyond.
1a8432f1 170
12fd9351
MK
171Before version 2.11,
172.\" It looks like the fix was in 2.11, or possibly 2.12.
173.\" I have no test system for 2.11, but 2.12 passes.
174.\" From the source (sysdeps/i386/fpu/s_expm1.S) it looks
175.\" like the changes were in 2.11.
176the glibc implementation did not set
177.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788
178.I errno
179to
180.B ERANGE
181when a range error occurred.
47297adb 182.SH SEE ALSO
fea681da
MK
183.BR exp (3),
184.BR log (3),
185.BR log1p (3)