1 .\" Copyright 1995 Jim Van Zandt <jrv@vanzandt.mv.com>
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\" Modified 2002-07-27 by Walter Harms
8 .\" (walter.harms@informatik.uni-oldenburg.de)
9 .TH LOG1P 3 2021-03-22 GNU "Linux Programmer's Manual"
11 log1p, log1pf, log1pl \- logarithm of 1 plus argument
14 .RI ( libm ", " \-lm )
19 .BI "double log1p(double " x );
20 .BI "float log1pf(float " x );
21 .BI "long double log1pl(long double " x );
25 Feature Test Macro Requirements for glibc (see
26 .BR feature_test_macros (7)):
31 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
32 || _XOPEN_SOURCE >= 500
33 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
34 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
35 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
42 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
43 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
46 These functions return a value equivalent to
52 The result is computed in a way
53 that is accurate even if the value of
57 On success, these functions return the natural logarithm of
67 is positive infinity, positive infinity is returned.
71 is \-1, a pole error occurs,
72 and the functions return
81 is less than \-1 (including negative infinity),
82 a domain error occurs,
83 and a NaN (not a number) is returned.
84 .\" POSIX.1 specifies a possible range error if x is subnormal
85 .\" glibc 2.8 doesn't do this
89 for information on how to determine whether an error has occurred
90 when calling these functions.
92 The following errors can occur:
94 Domain error: \fIx\fP is less than \-1
99 An invalid floating-point exception
103 Pole error: \fIx\fP is \-1
108 A divide-by-zero floating-point exception
112 For an explanation of the terms used in this section, see
120 Interface Attribute Value
125 T} Thread safety MT-Safe
131 C99, POSIX.1-2001, POSIX.1-2008.
134 Before version 2.22, the glibc implementation did not set
135 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6792
139 when a domain error occurred.
141 Before version 2.22, the glibc implementation did not set
142 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6792
146 when a range error occurred.