OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / 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  2008-08-05 "" "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 An overflow floating-point exception
115 .RB ( FE_OVERFLOW )
116 is raised.
117 .PP
118 These functions do not set
119 .IR errno .
120 .\" FIXME . Is it intentional that these functions do not set errno?
121 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6788
122 .\"
123 .\"
124 .\" POSIX.1 specifies an optional range error (underflow) if
125 .\" x is subnormal.  Glibc does not implement this.
126 .SH "CONFORMING TO"
127 C99, POSIX.1-2001.
128 .\" BSD.
129 .SH BUGS
130 For some large negative
131 .I x
132 values (where the function result approaches \-1),
133 .BR expm1 ()
134 raises a bogus underflow floating-point exception.
135 .\" FIXME .
136 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6778
137
138 For some large positive
139 .I x
140 values,
141 .BR expm1 ()
142 raises a bogus invalid floating-point exception in addition to the expected
143 overflow exception, and returns a NaN instead of positive infinity.
144 .\" FIXME .
145 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6814
146 .\" e.g., expm1(1e5) through expm1(1.00199970127e5),
147 .\" but not expm1(1.00199970128e5) and beyond.
148 .SH "SEE ALSO"
149 .BR exp (3),
150 .BR log (3),
151 .BR log1p (3)