Debian Codegraph @

upstream/debian-trixie/man3/exp.3

raw
1 '\" t
2 .\" Copyright 1993 David Metcalfe ([email protected])
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\" <[email protected]>
5 .\"
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
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 ([email protected])
13 .\" Modified 1995-08-14 by Arnt Gulbrandsen <[email protected]>
14 .\" Modified 2002-07-27 by Walter Harms
15 .\" ([email protected])
16 .\"
17 .TH exp 3 2024-05-02 "Linux man-pages 6.9.1"
18 .SH NAME
19 exp, expf, expl \- base-e exponential function
20 .SH LIBRARY
21 Math library
22 .RI ( libm ", " \-lm )
23 .SH SYNOPSIS
24 .nf
25 .B #include <math.h>
26 .P
27 .BI "double exp(double " x );
28 .BI "float expf(float " x );
29 .BI "long double expl(long double " x );
30 .fi
31 .P
32 .RS -4
33 Feature Test Macro Requirements for glibc (see
34 .BR feature_test_macros (7)):
35 .RE
36 .P
37 .BR expf (),
38 .BR expl ():
39 .nf
40 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
41 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
42 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
43 .fi
44 .SH DESCRIPTION
45 These functions return the value of e (the base of natural
46 logarithms) raised to the power of
47 .IR x .
48 .SH RETURN VALUE
49 On success, these functions return the exponential value of
50 .IR x .
51 .P
52 If
53 .I x
54 is a NaN,
55 a NaN is returned.
56 .P
57 If
58 .I x
59 is positive infinity,
60 positive infinity is returned.
61 .P
62 If
63 .I x
64 is negative infinity,
65 +0 is returned.
66 .P
67 If the result underflows,
68 a range error occurs,
69 and zero is returned.
70 .P
71 If the result overflows,
72 a range error occurs,
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.
84 .P
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.
102 .SH ATTRIBUTES
103 For an explanation of the terms used in this section, see
104 .BR attributes (7).
105 .TS
106 allbox;
107 lbx lb lb
108 l l l.
109 Interface Attribute Value
110 T{
111 .na
112 .nh
113 .BR exp (),
114 .BR expf (),
115 .BR expl ()
116 T} Thread safety MT-Safe
117 .TE
118 .SH STANDARDS
119 C11, POSIX.1-2008.
120 .SH HISTORY
121 C99, POSIX.1-2001.
122 .P
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)