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