1expm1(3)                   Library Functions Manual                   expm1(3)
2
3
4

NAME

6       expm1, expm1f, expm1l - exponential minus 1
7

LIBRARY

9       Math library (libm, -lm)
10

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

ATTRIBUTES

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

STANDARDS

75       C11, POSIX.1-2008.
76

HISTORY

78       C99, POSIX.1-2001.  BSD.
79

BUGS

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

SEE ALSO

94       exp(3), log(3), log1p(3)
95
96
97
98Linux man-pages 6.05              2023-07-20                          expm1(3)
Impressum