1EXP(3) Linux Programmer's Manual EXP(3)
2
3
4
6 exp, expf, expl - base-e exponential function
7
9 #include <math.h>
10
11 double exp(double x);
12 float expf(float x);
13 long double expl(long double x);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 expf(), expl():
20 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
21 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
22 or cc -std=c99
23
25 The exp() function returns the value of e (the base of natural loga‐
26 rithms) raised to the power of x.
27
29 On success, these functions return the exponential value of x.
30
31 If x is a NaN, a NaN is returned.
32
33 If x is positive infinity, positive infinity is returned.
34
35 If x is negative infinity, +0 is returned.
36
37 If the result underflows, a range error occurs, and zero is returned.
38
39 If the result overflows, a range error occurs, and the functions return
40 +HUGE_VAL, +HUGE_VALF, or +HUGE_VALL, respectively.
41
43 See math_error(7) for information on how to determine whether an error
44 has occurred when calling these functions.
45
46 The following errors can occur:
47
48 Range error, overflow
49 errno is set to ERANGE. An overflow floating-point exception
50 (FE_OVERFLOW) is raised.
51
52 Range error, underflow
53 errno is set to ERANGE. An underflow floating-point exception
54 (FE_UNDERFLOW) is raised.
55
57 C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
58 4.3BSD, C89.
59
61 cbrt(3), cexp(3), exp10(3), exp2(3), sqrt(3)
62
64 This page is part of release 3.53 of the Linux man-pages project. A
65 description of the project, and information about reporting bugs, can
66 be found at http://www.kernel.org/doc/man-pages/.
67
68
69
70 2010-09-20 EXP(3)