]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/expm1.3
cos.3, expm1.3, sin.3, tan.3: Remove crufty text left over after recent fixes
[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 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified 2002-07-27 Walter Harms
26 .\" (walter.harms@informatik.uni-oldenburg.de)
27 .\"
28 .TH EXPM1 3 2010-09-12 "" "Linux Programmer's Manual"
29 .SH NAME
30 expm1, expm1f, expm1l \- exponential minus 1
31 .SH SYNOPSIS
32 .nf
33 .B #include <math.h>
34 .sp
35 .BI "double expm1(double " x );
36 .br
37 .BI "float expm1f(float " x );
38 .br
39 .BI "long double expm1l(long double " x );
40 .sp
41 .fi
42 Link with \fI\-lm\fP.
43 .sp
44 .in -4n
45 Feature Test Macro Requirements for glibc (see
46 .BR feature_test_macros (7)):
47 .in
48 .sp
49 .ad l
50 .BR expm1 ():
51 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or
52 .I cc\ -std=c99
53 .br
54 .BR expm1f (),
55 .BR expm1l ():
56 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
57 .I cc\ -std=c99
58 .ad b
59 .SH DESCRIPTION
60 .I expm1(x)
61 returns a value equivalent to
62 .nf
63
64 exp(x) \- 1
65
66 .fi
67 It is
68 computed in a way that is accurate even if the value of \fIx\fP is near
69 zero\(ema case where
70 .I "exp(x) \- 1"
71 would be inaccurate due to
72 subtraction of two numbers that are nearly equal.
73 .SH RETURN VALUE
74 On success, these functions return
75 .IR "exp(x)\ \-\ 1" .
76
77 If
78 .I x
79 is a NaN,
80 a NaN is returned.
81
82 If
83 .I x
84 is +0 (\-0),
85 +0 (\-0) is returned.
86
87 If
88 .I x
89 is positive infinity, positive infinity is returned.
90
91 If
92 .I x
93 is negative infinity, \-1 is returned.
94
95 If the result overflows, a range error occurs,
96 and the functions return
97 .RB - HUGE_VAL ,
98 .RB - HUGE_VALF ,
99 or
100 .RB - HUGE_VALL ,
101 respectively.
102 .SH ERRORS
103 See
104 .BR math_error (7)
105 for information on how to determine whether an error has occurred
106 when calling these functions.
107 .PP
108 The following errors can occur:
109 .TP
110 Range error, overflow
111 .I errno
112 is set to
113 .BR ERANGE
114 (but see BUGS).
115 An overflow floating-point exception
116 .RB ( FE_OVERFLOW )
117 is raised.
118 .\"
119 .\" POSIX.1 specifies an optional range error (underflow) if
120 .\" x is subnormal. Glibc does not implement this.
121 .SH "CONFORMING TO"
122 C99, POSIX.1-2001.
123 .\" BSD.
124 .SH BUGS
125 For some large negative
126 .I x
127 values (where the function result approaches \-1),
128 .BR expm1 ()
129 raises a bogus underflow floating-point exception.
130 .\" FIXME .
131 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778
132
133 For some large positive
134 .I x
135 values,
136 .BR expm1 ()
137 raises a bogus invalid floating-point exception in addition to the expected
138 overflow exception, and returns a NaN instead of positive infinity.
139 .\" FIXME .
140 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6814
141 .\" e.g., expm1(1e5) through expm1(1.00199970127e5),
142 .\" but not expm1(1.00199970128e5) and beyond.
143 .SH BUGS
144 Before version 2.11,
145 .\" It looks like the fix was in 2.11, or possibly 2.12.
146 .\" I have no test system for 2.11, but 2.12 passes.
147 .\" From the source (sysdeps/i386/fpu/s_expm1.S) it looks
148 .\" like the changes were in 2.11.
149 the glibc implementation did not set
150 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788
151 .I errno
152 to
153 .B ERANGE
154 when a range error occurred.
155 .SH "SEE ALSO"
156 .BR exp (3),
157 .BR log (3),
158 .BR log1p (3)