OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / man3 / log1p.3
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>
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified 2002-07-27 by Walter Harms
26 .\"     (walter.harms@informatik.uni-oldenburg.de)
27 .TH LOG1P 3   2008-08-05 "" "Linux Programmer's Manual"
28 .SH NAME
29 log1p, log1pf, log1pl \-  logarithm of 1 plus argument
30 .SH SYNOPSIS
31 .nf
32 .B #include <math.h>
33 .sp
34 .BI "double log1p(double " x );
35 .br
36 .BI "float log1pf(float " x );
37 .br
38 .BI "long double log1pl(long double " x );
39 .sp
40 .fi
41 Link with \fI\-lm\fP.
42 .sp
43 .in -4n
44 Feature Test Macro Requirements for glibc (see
45 .BR feature_test_macros (7)):
46 .in
47 .sp
48 .ad l
49 .BR log1p ():
50 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _ISOC99_SOURCE; or
51 .I cc\ -std=c99
52 .br
53 .BR log1pf (),
54 .BR log1pl ():
55 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
56 .I cc\ -std=c99
57 .ad b
58 .SH DESCRIPTION
59 .I log1p(x)
60 returns a value equivalent to
61 .nf
62
63     log (1 + \fIx\fP)
64
65 .fi
66 It is computed in a way
67 that is accurate even if the value of \fIx\fP is near zero.
68 .SH RETURN VALUE
69 On success, these functions return the natural logarithm of
70 .IR "(1\ +\ x)" .
71
72 If
73 .I x
74 is a NaN,
75 a NaN is returned.
76
77 If
78 .I x
79 is positive infinity, positive infinity is returned.
80
81 If
82 .I x
83 is \-1, a pole error occurs,
84 and the functions return
85 .RB - HUGE_VAL ,
86 .RB - HUGE_VALF ,
87 or
88 .RB - HUGE_VALL ,
89 respectively.
90
91 If
92 .I x
93 is less than \-1 (including negative infinity),
94 a domain error occurs,
95 and a NaN (not a number) is returned.
96 .\" POSIX.1 specifies a possible range error if x is subnormal
97 .\" glibc 2.8 doesn't do this
98 .SH ERRORS
99 See
100 .BR math_error (7)
101 for information on how to determine whether an error has occurred
102 when calling these functions.
103 .PP
104 The following errors can occur:
105 .TP
106 Domain error: \fIx\fP is less than \-1
107 .\" .I errno
108 .\" is set to
109 .\" .BR EDOM .
110 An invalid floating-point exception
111 .RB ( FE_INVALID )
112 is raised.
113 .TP
114 Pole error: \fIx\fP is \-1
115 .\" .I errno
116 .\" is set to
117 .\" .BR ERANGE .
118 A divide-by-zero floating-point exception
119 .RB ( FE_DIVBYZERO )
120 is raised.
121 .PP
122 These functions do not set
123 .IR errno .
124 .\" FIXME . Is it intentional that these functions do not set errno?
125 .\" log(), log2(), log10() do set errno
126 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6792
127 .SH "CONFORMING TO"
128 C99, POSIX.1-2001.
129 .\" BSD
130 .SH "SEE ALSO"
131 .BR exp (3),
132 .BR expm1 (3),
133 .BR log (3)