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