]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/expm1.3
_exit.2, abs.3, acos.3, acosh.3, asin.3, asinh.3, atan.3, atan2.3, atanh.3, atoi...
[thirdparty/man-pages.git] / man3 / expm1.3
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>
4 .\"
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.
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.
14 .\"
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.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\" Modified 2002-07-27 Walter Harms
28 .\" (walter.harms@informatik.uni-oldenburg.de)
29 .\"
30 .TH EXPM1 3 2015-04-19 "" "Linux Programmer's Manual"
31 .SH NAME
32 expm1, expm1f, expm1l \- exponential minus 1
33 .SH SYNOPSIS
34 .nf
35 .B #include <math.h>
36 .sp
37 .BI "double expm1(double " x );
38 .br
39 .BI "float expm1f(float " x );
40 .br
41 .BI "long double expm1l(long double " x );
42 .sp
43 .fi
44 Link with \fI\-lm\fP.
45 .sp
46 .in -4n
47 Feature Test Macro Requirements for glibc (see
48 .BR feature_test_macros (7)):
49 .in
50 .sp
51 .ad l
52 .BR expm1 ():
53 .RS 4
54 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
55 || _XOPEN_SOURCE\ >=\ 500
56 .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
57 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
58 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
59 .RE
60 .br
61 .BR expm1f (),
62 .BR expm1l ():
63 .RS 4
64 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
65 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
66 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
67 .RE
68 .ad b
69 .SH DESCRIPTION
70 These functions return a value equivalent to
71 .nf
72
73 exp(x) \- 1
74
75 .fi
76 The result is computed in a way that is accurate even if the value of
77 .I x
78 is near
79 zero\(ema case where
80 .I "exp(x) \- 1"
81 would be inaccurate due to
82 subtraction of two numbers that are nearly equal.
83 .SH RETURN VALUE
84 On success, these functions return
85 .IR "exp(x)\ \-\ 1" .
86
87 If
88 .I x
89 is a NaN,
90 a NaN is returned.
91
92 If
93 .I x
94 is +0 (\-0),
95 +0 (\-0) is returned.
96
97 If
98 .I x
99 is positive infinity, positive infinity is returned.
100
101 If
102 .I x
103 is negative infinity, \-1 is returned.
104
105 If the result overflows, a range error occurs,
106 and the functions return
107 .RB - HUGE_VAL ,
108 .RB - HUGE_VALF ,
109 or
110 .RB - HUGE_VALL ,
111 respectively.
112 .SH ERRORS
113 See
114 .BR math_error (7)
115 for information on how to determine whether an error has occurred
116 when calling these functions.
117 .PP
118 The following errors can occur:
119 .TP
120 Range error, overflow
121 .I errno
122 is set to
123 .BR ERANGE
124 (but see BUGS).
125 An overflow floating-point exception
126 .RB ( FE_OVERFLOW )
127 is raised.
128 .\"
129 .\" POSIX.1 specifies an optional range error (underflow) if
130 .\" x is subnormal. Glibc does not implement this.
131 .SH ATTRIBUTES
132 For an explanation of the terms used in this section, see
133 .BR attributes (7).
134 .TS
135 allbox;
136 lbw27 lb lb
137 l l l.
138 Interface Attribute Value
139 T{
140 .BR expm1 (),
141 .BR expm1f (),
142 .BR expm1l ()
143 T} Thread safety MT-Safe
144 .TE
145 .SH CONFORMING TO
146 C99, POSIX.1-2001, POSIX.1-2008.
147 .\" BSD.
148 .SH BUGS
149 For some large negative
150 .I x
151 values (where the function result approaches \-1),
152 .BR expm1 ()
153 raises a bogus underflow floating-point exception.
154 .\" FIXME .
155 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778
156
157 For some large positive
158 .I x
159 values,
160 .BR expm1 ()
161 raises a bogus invalid floating-point exception in addition to the expected
162 overflow 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.
167
168 Before 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.
173 the glibc implementation did not set
174 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788
175 .I errno
176 to
177 .B ERANGE
178 when a range error occurred.
179 .SH SEE ALSO
180 .BR exp (3),
181 .BR log (3),
182 .BR log1p (3)