]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/log1p.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / log1p.3
CommitLineData
fea681da 1.\" Copyright 1995 Jim Van Zandt <jrv@vanzandt.mv.com>
caba2e47
MK
2.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3.\" <mtk.manpages@gmail.com>
fea681da 4.\"
5fbde956 5.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
6.\"
7.\" Modified 2002-07-27 by Walter Harms
8.\" (walter.harms@informatik.uni-oldenburg.de)
45186a5d 9.TH LOG1P 3 2021-03-22 "Linux man-pages (unreleased)"
fea681da 10.SH NAME
9a2d673e 11log1p, log1pf, log1pl \- logarithm of 1 plus argument
297a126f
AC
12.SH LIBRARY
13Math library
8fc3b2cf 14.RI ( libm ", " \-lm )
fea681da
MK
15.SH SYNOPSIS
16.nf
17.B #include <math.h>
68e4db0a 18.PP
fea681da 19.BI "double log1p(double " x );
fea681da 20.BI "float log1pf(float " x );
fea681da 21.BI "long double log1pl(long double " x );
68e4db0a 22.PP
fea681da 23.fi
d39ad78f 24.RS -4
cc4615cc
MK
25Feature Test Macro Requirements for glibc (see
26.BR feature_test_macros (7)):
d39ad78f 27.RE
68e4db0a 28.PP
9d2adbae 29.nf
caba2e47 30.BR log1p ():
5c10d2c5
MK
31 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
32 || _XOPEN_SOURCE >= 500
33.\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
9d2adbae
MK
34 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
35 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
36.fi
98c9347c 37.PP
cc4615cc
MK
38.BR log1pf (),
39.BR log1pl ():
9d2adbae 40.nf
5c10d2c5 41 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
9d2adbae
MK
42 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
43 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
44.fi
fea681da 45.SH DESCRIPTION
5600f73a 46These functions return a value equivalent to
207050fa 47.PP
2d986c92 48.nf
2d986c92 49 log (1 + \fIx\fP)
2d986c92 50.fi
207050fa 51.PP
5600f73a 52The result is computed in a way
022671eb
MK
53that is accurate even if the value of
54.I x
55is near zero.
caba2e47
MK
56.SH RETURN VALUE
57On success, these functions return the natural logarithm of
58.IR "(1\ +\ x)" .
847e0d88 59.PP
caba2e47
MK
60If
61.I x
62is a NaN,
63a NaN is returned.
847e0d88 64.PP
caba2e47
MK
65If
66.I x
67is positive infinity, positive infinity is returned.
847e0d88 68.PP
caba2e47
MK
69If
70.I x
efe294cb 71is \-1, a pole error occurs,
caba2e47 72and the functions return
cd415e73
MK
73.RB \- HUGE_VAL ,
74.RB \- HUGE_VALF ,
caba2e47 75or
cd415e73 76.RB \- HUGE_VALL ,
caba2e47 77respectively.
847e0d88 78.PP
caba2e47
MK
79If
80.I x
81is less than \-1 (including negative infinity),
efe294cb 82a domain error occurs,
caba2e47
MK
83and 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
86.SH ERRORS
87See
88.BR math_error (7)
89for information on how to determine whether an error has occurred
90when calling these functions.
91.PP
92The following errors can occur:
93.TP
94Domain error: \fIx\fP is less than \-1
523e7e59
AH
95.I errno
96is set to
1ae6b2c7 97.B EDOM
523e7e59 98(but see BUGS).
caba2e47
MK
99An invalid floating-point exception
100.RB ( FE_INVALID )
101is raised.
102.TP
103Pole error: \fIx\fP is \-1
523e7e59
AH
104.I errno
105is set to
1ae6b2c7 106.B ERANGE
523e7e59 107(but see BUGS).
caba2e47
MK
108A divide-by-zero floating-point exception
109.RB ( FE_DIVBYZERO )
110is raised.
d05cb848 111.SH ATTRIBUTES
eb71cf70
MK
112For an explanation of the terms used in this section, see
113.BR attributes (7).
c466875e
MK
114.ad l
115.nh
eb71cf70
MK
116.TS
117allbox;
c466875e 118lbx lb lb
eb71cf70
MK
119l l l.
120Interface Attribute Value
121T{
d05cb848
PH
122.BR log1p (),
123.BR log1pf (),
d05cb848 124.BR log1pl ()
eb71cf70
MK
125T} Thread safety MT-Safe
126.TE
c466875e
MK
127.hy
128.ad
129.sp 1
3113c7f3 130.SH STANDARDS
9a74e018 131C99, POSIX.1-2001, POSIX.1-2008.
caba2e47 132.\" BSD
523e7e59
AH
133.SH BUGS
134Before version 2.22, the glibc implementation did not set
135.\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6792
136.I errno
137to
138.B EDOM
139when a domain error occurred.
847e0d88 140.PP
523e7e59
AH
141Before version 2.22, the glibc implementation did not set
142.\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6792
143.I errno
144to
145.B ERANGE
146when a range error occurred.
47297adb 147.SH SEE ALSO
fea681da
MK
148.BR exp (3),
149.BR expm1 (3),
150.BR log (3)