1LOG1P(3) Linux Programmer's Manual LOG1P(3)
2
3
4
6 log1p, log1pf, log1pl - logarithm of 1 plus argument
7
9 #include <math.h>
10
11 double log1p(double x);
12 float log1pf(float x);
13 long double log1pl(long double x);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 log1p(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 ||
20 _ISOC99_SOURCE; or cc -std=c99
21 log1pf(), log1pl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
22 || _ISOC99_SOURCE; or cc -std=c99
23
25 log1p(x) returns a value equivalent to
26
27 log (1 + x)
28
29 It is computed in a way that is accurate even if the value of x is near
30 zero.
31
33 On success, these functions return the natural logarithm of (1 + x).
34
35 If x is a NaN, a NaN is returned.
36
37 If x is positive infinity, positive infinity is returned.
38
39 If x is -1, a pole error occurs, and the functions return -HUGE_VAL,
40 -HUGE_VALF, or -HUGE_VALL, respectively.
41
42 If x is less than -1 (including negative infinity), a domain error
43 occurs, and a NaN (not a number) is returned.
44
46 See math_error(7) for information on how to determine whether an error
47 has occurred when calling these functions.
48
49 The following errors can occur:
50
51 Domain error: x is less than -1
52 An invalid floating-point exception (FE_INVALID) is raised.
53
54 Pole error: x is -1
55 A divide-by-zero floating-point exception (FE_DIVBYZERO) is
56 raised.
57
58 These functions do not set errno.
59
61 C99, POSIX.1-2001.
62
64 exp(3), expm1(3), log(3)
65
67 This page is part of release 3.25 of the Linux man-pages project. A
68 description of the project, and information about reporting bugs, can
69 be found at http://www.kernel.org/doc/man-pages/.
70
71
72
73 2008-08-05 LOG1P(3)