1EXPM1(3)                   Linux Programmer's Manual                  EXPM1(3)
2
3
4

NAME

6       expm1, expm1f, expm1l - exponential minus 1
7

SYNOPSIS

9       #include <math.h>
10
11       double expm1(double x);
12       float expm1f(float x);
13       long double expm1l(long double x);
14
15       Link with -lm.
16
17   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19       expm1():
20           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
21               || _XOPEN_SOURCE >= 500
22               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23               || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24
25       expm1f(), expm1l():
26           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
27               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
28               || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
29

DESCRIPTION

31       These functions return a value equivalent to
32
33           exp(x) - 1
34
35       The result is computed in a way that is accurate even if the value of x
36       is near zero—a case where exp(x) - 1 would be inaccurate  due  to  sub‐
37       traction of two numbers that are nearly equal.
38

RETURN VALUE

40       On success, these functions return exp(x) - 1.
41
42       If x is a NaN, a NaN is returned.
43
44       If x is +0 (-0), +0 (-0) is returned.
45
46       If x is positive infinity, positive infinity is returned.
47
48       If x is negative infinity, -1 is returned.
49
50       If the result overflows, a range error occurs, and the functions return
51       -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively.
52

ERRORS

54       See math_error(7) for information on how to determine whether an  error
55       has occurred when calling these functions.
56
57       The following errors can occur:
58
59       Range error, overflow
60              errno  is  set  to ERANGE (but see BUGS).  An overflow floating-
61              point exception (FE_OVERFLOW) is raised.
62

ATTRIBUTES

64       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
65       tributes(7).
66
67       ┌────────────────────────────────────────────┬───────────────┬─────────┐
68Interface                                   Attribute     Value   
69       ├────────────────────────────────────────────┼───────────────┼─────────┤
70expm1(), expm1f(), expm1l()                 │ Thread safety │ MT-Safe │
71       └────────────────────────────────────────────┴───────────────┴─────────┘
72

CONFORMING TO

74       C99, POSIX.1-2001, POSIX.1-2008.
75

BUGS

77       Before glibc 2.17, on certain architectures (e.g., x86, but not x86_64)
78       expm1() raised a bogus  underflow  floating-point  exception  for  some
79       large negative x values (where the function result approaches -1).
80
81       Before approximately glibc version 2.11, expm1() raised a bogus invalid
82       floating-point exception in addition to the  expected  overflow  excep‐
83       tion,  and  returned a NaN instead of positive infinity, for some large
84       positive x values.
85
86       Before version 2.11, the glibc implementation  did  not  set  errno  to
87       ERANGE when a range error occurred.
88

SEE ALSO

90       exp(3), log(3), log1p(3)
91

COLOPHON

93       This  page  is  part of release 5.13 of the Linux man-pages project.  A
94       description of the project, information about reporting bugs,  and  the
95       latest     version     of     this    page,    can    be    found    at
96       https://www.kernel.org/doc/man-pages/.
97
98
99
100                                  2021-03-22                          EXPM1(3)
Impressum