1log1p(3) Library Functions Manual log1p(3)
2
3
4
6 log1p, log1pf, log1pl - logarithm of 1 plus argument
7
9 Math library (libm, -lm)
10
12 #include <math.h>
13
14 double log1p(double x);
15 float log1pf(float x);
16 long double log1pl(long double x);
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 log1p():
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 log1pf(), log1pl():
27 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
28 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
29 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
30
32 These functions return a value equivalent to
33
34 log (1 + x)
35
36 The result is computed in a way that is accurate even if the value of x
37 is near zero.
38
40 On success, these functions return the natural logarithm of (1 + x).
41
42 If x is a NaN, a NaN is returned.
43
44 If x is positive infinity, positive infinity is returned.
45
46 If x is -1, a pole error occurs, and the functions return -HUGE_VAL,
47 -HUGE_VALF, or -HUGE_VALL, respectively.
48
49 If x is less than -1 (including negative infinity), a domain error oc‐
50 curs, and a NaN (not a number) is returned.
51
53 See math_error(7) for information on how to determine whether an error
54 has occurred when calling these functions.
55
56 The following errors can occur:
57
58 Domain error: x is less than -1
59 errno is set to EDOM (but see BUGS). An invalid floating-point
60 exception (FE_INVALID) is raised.
61
62 Pole error: x is -1
63 errno is set to ERANGE (but see BUGS). A divide-by-zero float‐
64 ing-point exception (FE_DIVBYZERO) is raised.
65
67 For an explanation of the terms used in this section, see at‐
68 tributes(7).
69
70 ┌────────────────────────────────────────────┬───────────────┬─────────┐
71 │Interface │ Attribute │ Value │
72 ├────────────────────────────────────────────┼───────────────┼─────────┤
73 │log1p(), log1pf(), log1pl() │ Thread safety │ MT-Safe │
74 └────────────────────────────────────────────┴───────────────┴─────────┘
75
77 C11, POSIX.1-2008.
78
80 C99, POSIX.1-2001.
81
83 Before glibc 2.22, the glibc implementation did not set errno to EDOM
84 when a domain error occurred.
85
86 Before glibc 2.22, the glibc implementation did not set errno to ERANGE
87 when a range error occurred.
88
90 exp(3), expm1(3), log(3)
91
92
93
94Linux man-pages 6.05 2023-07-20 log1p(3)