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