]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da | 2 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
3888e219 MK |
3 | .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk |
4 | .\" <mtk.manpages@gmail.com> | |
fea681da | 5 | .\" |
5fbde956 | 6 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
7 | .\" |
8 | .\" References consulted: | |
9 | .\" Linux libc source code | |
10 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
11 | .\" 386BSD man pages | |
12 | .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) | |
13 | .\" Modified 1995-08-14 by Arnt Gulbrandsen <agulbra@troll.no> | |
14 | .\" Modified 2002-07-27 by Walter Harms | |
15 | .\" (walter.harms@informatik.uni-oldenburg.de) | |
16 | .\" | |
4c1c5274 | 17 | .TH exp 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
18 | .SH NAME |
19 | exp, expf, expl \- base-e exponential function | |
2af19291 AC |
20 | .SH LIBRARY |
21 | Math library | |
8fc3b2cf | 22 | .RI ( libm ", " \-lm ) |
fea681da MK |
23 | .SH SYNOPSIS |
24 | .nf | |
25 | .B #include <math.h> | |
c6d039a3 | 26 | .P |
fea681da | 27 | .BI "double exp(double " x ); |
fea681da | 28 | .BI "float expf(float " x ); |
fea681da MK |
29 | .BI "long double expl(long double " x ); |
30 | .fi | |
c6d039a3 | 31 | .P |
d39ad78f | 32 | .RS -4 |
3888e219 MK |
33 | Feature Test Macro Requirements for glibc (see |
34 | .BR feature_test_macros (7)): | |
d39ad78f | 35 | .RE |
c6d039a3 | 36 | .P |
3888e219 MK |
37 | .BR expf (), |
38 | .BR expl (): | |
9d2adbae | 39 | .nf |
5c10d2c5 | 40 | _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L |
9d2adbae | 41 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE |
75c018a1 | 42 | || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE |
9d2adbae | 43 | .fi |
fea681da | 44 | .SH DESCRIPTION |
5600f73a | 45 | These functions return the value of e (the base of natural |
022671eb MK |
46 | logarithms) raised to the power of |
47 | .IR x . | |
3888e219 MK |
48 | .SH RETURN VALUE |
49 | On success, these functions return the exponential value of | |
50 | .IR x . | |
c6d039a3 | 51 | .P |
3888e219 MK |
52 | If |
53 | .I x | |
54 | is a NaN, | |
55 | a NaN is returned. | |
c6d039a3 | 56 | .P |
3888e219 MK |
57 | If |
58 | .I x | |
59 | is positive infinity, | |
60 | positive infinity is returned. | |
c6d039a3 | 61 | .P |
3888e219 MK |
62 | If |
63 | .I x | |
64 | is negative infinity, | |
65 | +0 is returned. | |
c6d039a3 | 66 | .P |
3888e219 | 67 | If the result underflows, |
efe294cb | 68 | a range error occurs, |
3888e219 | 69 | and zero is returned. |
c6d039a3 | 70 | .P |
3888e219 | 71 | If the result overflows, |
efe294cb | 72 | a range error occurs, |
3888e219 MK |
73 | and the functions return |
74 | .RB + HUGE_VAL , | |
75 | .RB + HUGE_VALF , | |
76 | or | |
77 | .RB + HUGE_VALL , | |
78 | respectively. | |
79 | .SH ERRORS | |
80 | See | |
81 | .BR math_error (7) | |
82 | for information on how to determine whether an error has occurred | |
83 | when calling these functions. | |
c6d039a3 | 84 | .P |
3888e219 MK |
85 | The following errors can occur: |
86 | .TP | |
87 | Range error, overflow | |
88 | .I errno | |
89 | is set to | |
90 | .BR ERANGE . | |
91 | An overflow floating-point exception | |
92 | .RB ( FE_OVERFLOW ) | |
93 | is raised. | |
94 | .TP | |
95 | Range error, underflow | |
96 | .I errno | |
97 | is set to | |
98 | .BR ERANGE . | |
99 | An underflow floating-point exception | |
100 | .RB ( FE_UNDERFLOW ) | |
101 | is raised. | |
bee8bfce MS |
102 | .SH ATTRIBUTES |
103 | For an explanation of the terms used in this section, see | |
104 | .BR attributes (7). | |
105 | .TS | |
106 | allbox; | |
c466875e | 107 | lbx lb lb |
bee8bfce MS |
108 | l l l. |
109 | Interface Attribute Value | |
110 | T{ | |
9e54434e BR |
111 | .na |
112 | .nh | |
bee8bfce MS |
113 | .BR exp (), |
114 | .BR expf (), | |
115 | .BR expl () | |
116 | T} Thread safety MT-Safe | |
117 | .TE | |
3113c7f3 | 118 | .SH STANDARDS |
4131356c AC |
119 | C11, POSIX.1-2008. |
120 | .SH HISTORY | |
121 | C99, POSIX.1-2001. | |
c6d039a3 | 122 | .P |
3888e219 MK |
123 | The variant returning |
124 | .I double | |
125 | also conforms to | |
e0089d55 | 126 | SVr4, 4.3BSD, C89. |
47297adb | 127 | .SH SEE ALSO |
fea681da | 128 | .BR cbrt (3), |
36268806 | 129 | .BR cexp (3), |
fea681da MK |
130 | .BR exp10 (3), |
131 | .BR exp2 (3), | |
254f636a | 132 | .BR expm1 (3), |
fea681da | 133 | .BR sqrt (3) |