.\"
.\" Modified 2002-07-27 by Walter Harms
.\" (walter.harms@informatik.uni-oldenburg.de)
-.TH LOG1P 3 2015-03-02 "" "Linux Programmer's Manual"
+.TH LOG1P 3 2017-09-15 "" "Linux Programmer's Manual"
.SH NAME
log1p, log1pf, log1pl \- logarithm of 1 plus argument
.SH SYNOPSIS
.nf
.B #include <math.h>
-.sp
+.PP
.BI "double log1p(double " x );
-.br
.BI "float log1pf(float " x );
-.br
.BI "long double log1pl(long double " x );
-.sp
+.PP
.fi
Link with \fI\-lm\fP.
-.sp
+.PP
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
-.sp
+.PP
.ad l
.BR log1p ():
.RS 4
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
-_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE ||
-_POSIX_C_SOURCE\ >=\ 200112L;
-.br
-or
-.I cc\ -std=c99
+_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
+ || _XOPEN_SOURCE\ >=\ 500
+.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
+ || /* Since glibc 2.19: */ _DEFAULT_SOURCE
+ || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
.RE
.br
.BR log1pf (),
.BR log1pl ():
.RS 4
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
-_POSIX_C_SOURCE\ >=\ 200112L;
-.br
-or
-.I cc\ -std=c99
+_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
+ || /* Since glibc 2.19: */ _DEFAULT_SOURCE
+ || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
.RE
.ad b
.SH DESCRIPTION
-.I log1p(x)
-returns a value equivalent to
+These functions return a value equivalent to
+.PP
.nf
-
log (1 + \fIx\fP)
-
.fi
-It is computed in a way
+.PP
+The result is computed in a way
that is accurate even if the value of
.I x
is near zero.
.SH RETURN VALUE
On success, these functions return the natural logarithm of
.IR "(1\ +\ x)" .
-
+.PP
If
.I x
is a NaN,
a NaN is returned.
-
+.PP
If
.I x
is positive infinity, positive infinity is returned.
-
+.PP
If
.I x
is \-1, a pole error occurs,
or
.RB - HUGE_VALL ,
respectively.
-
+.PP
If
.I x
is less than \-1 (including negative infinity),
The following errors can occur:
.TP
Domain error: \fIx\fP is less than \-1
-.\" .I errno
-.\" is set to
-.\" .BR EDOM .
+.I errno
+is set to
+.BR EDOM
+(but see BUGS).
An invalid floating-point exception
.RB ( FE_INVALID )
is raised.
.TP
Pole error: \fIx\fP is \-1
-.\" .I errno
-.\" is set to
-.\" .BR ERANGE .
+.I errno
+is set to
+.BR ERANGE
+(but see BUGS).
A divide-by-zero floating-point exception
.RB ( FE_DIVBYZERO )
is raised.
-.PP
-These functions do not set
-.IR errno .
-.\" FIXME . Is it intentional that these functions do not set errno?
-.\" log(), log2(), log10() do set errno
-.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6792
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
T} Thread safety MT-Safe
.TE
.SH CONFORMING TO
-C99, POSIX.1-2001.
+C99, POSIX.1-2001, POSIX.1-2008.
.\" BSD
+.SH BUGS
+Before version 2.22, the glibc implementation did not set
+.\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6792
+.I errno
+to
+.B EDOM
+when a domain error occurred.
+.PP
+Before version 2.22, the glibc implementation did not set
+.\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6792
+.I errno
+to
+.B ERANGE
+when a range error occurred.
.SH SEE ALSO
.BR exp (3),
.BR expm1 (3),