]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/exp.3
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man3 / exp.3
CommitLineData
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
19exp, expf, expl \- base-e exponential function
2af19291
AC
20.SH LIBRARY
21Math 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
33Feature 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 45These functions return the value of e (the base of natural
022671eb
MK
46logarithms) raised to the power of
47.IR x .
3888e219
MK
48.SH RETURN VALUE
49On success, these functions return the exponential value of
50.IR x .
c6d039a3 51.P
3888e219
MK
52If
53.I x
54is a NaN,
55a NaN is returned.
c6d039a3 56.P
3888e219
MK
57If
58.I x
59is positive infinity,
60positive infinity is returned.
c6d039a3 61.P
3888e219
MK
62If
63.I x
64is negative infinity,
65+0 is returned.
c6d039a3 66.P
3888e219 67If the result underflows,
efe294cb 68a range error occurs,
3888e219 69and zero is returned.
c6d039a3 70.P
3888e219 71If the result overflows,
efe294cb 72a range error occurs,
3888e219
MK
73and the functions return
74.RB + HUGE_VAL ,
75.RB + HUGE_VALF ,
76or
77.RB + HUGE_VALL ,
78respectively.
79.SH ERRORS
80See
81.BR math_error (7)
82for information on how to determine whether an error has occurred
83when calling these functions.
c6d039a3 84.P
3888e219
MK
85The following errors can occur:
86.TP
87Range error, overflow
88.I errno
89is set to
90.BR ERANGE .
91An overflow floating-point exception
92.RB ( FE_OVERFLOW )
93is raised.
94.TP
95Range error, underflow
96.I errno
97is set to
98.BR ERANGE .
99An underflow floating-point exception
100.RB ( FE_UNDERFLOW )
101is raised.
bee8bfce
MS
102.SH ATTRIBUTES
103For an explanation of the terms used in this section, see
104.BR attributes (7).
105.TS
106allbox;
c466875e 107lbx lb lb
bee8bfce
MS
108l l l.
109Interface Attribute Value
110T{
9e54434e
BR
111.na
112.nh
bee8bfce
MS
113.BR exp (),
114.BR expf (),
115.BR expl ()
116T} Thread safety MT-Safe
117.TE
3113c7f3 118.SH STANDARDS
4131356c
AC
119C11, POSIX.1-2008.
120.SH HISTORY
121C99, POSIX.1-2001.
c6d039a3 122.P
3888e219
MK
123The variant returning
124.I double
125also conforms to
e0089d55 126SVr4, 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)