OSDN Git Service

Merge branch 'work-coreutils'
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / log.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
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 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified 1995-08-14 by Arnt Gulbrandsen <agulbra@troll.no>
31 .\" Modified 2002-07-27 by Walter Harms
32 .\"     (walter.harms@informatik.uni-oldenburg.de)
33 .\"
34 .\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
35 .\"         all rights reserved.
36 .\" Translated Wed Aug  6 00:35:20 JST 2003
37 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
38 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
39 .\"
40 .TH LOG 3  2010-09-20  "" "Linux Programmer's Manual"
41 .\"O .SH NAME
42 .\"O log, logf, logl \- natural logarithmic function
43 .SH 名前
44 log, logf, logl \- 自然対数関数
45 .\"O .SH SYNOPSIS
46 .SH 書式
47 .nf
48 .B #include <math.h>
49 .sp
50 .BI "double log(double " x );
51 .br
52 .BI "float logf(float " x );
53 .br
54 .BI "long double logl(long double " x );
55 .fi
56 .sp
57 .\"O Link with \fI\-lm\fP.
58 \fI\-lm\fP でリンクする。
59 .sp
60 .in -4n
61 .\"O Feature Test Macro Requirements for glibc (see
62 .\"O .BR feature_test_macros (7)):
63 glibc 向けの機能検査マクロの要件
64 .RB ( feature_test_macros (7)
65 参照):
66 .in
67 .sp
68 .ad l
69 .BR logf (),
70 .BR logl ():
71 .RS 4
72 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
73 _POSIX_C_SOURCE\ >=\ 200112L;
74 .br
75 or
76 .I cc\ -std=c99
77 .RE
78 .ad
79 .\"O .SH DESCRIPTION
80 .SH 説明
81 .\"O The
82 .\"O .BR log ()
83 .\"O function returns the natural logarithm of \fIx\fP.
84 .BR log ()
85 関数は \fIx\fP の自然対数を返す。
86 .\"O .SH RETURN VALUE
87 .SH 返り値
88 .\"O On success, these functions return the natural logarithm of
89 .\"O .IR x .
90 成功すると、これらの関数は
91 .I x
92 の自然対数を返す。
93
94 .\"O If
95 .\"O .I x
96 .\"O is a NaN,
97 .\"O a NaN is returned.
98 .I x
99 が NaN の場合、NaN が返される。
100
101 .\"O If
102 .\"O .I x
103 .\"O is 1, the result is +0.
104 .I x
105 が 1 の場合、+0 が返される。
106
107 .\"O If
108 .\"O .I x
109 .\"O is positive infinity,
110 .\"O positive infinity is returned.
111 .I x
112 が正の無限大の場合、正の無限大が返される。
113
114 .\"O If
115 .\"O .I x
116 .\"O is zero,
117 .\"O then a pole error occurs, and the functions return
118 .\"O .RB - HUGE_VAL ,
119 .\"O .RB - HUGE_VALF ,
120 .\"O or
121 .\"O .RB - HUGE_VALL ,
122 .\"O respectively.
123 .I x
124 が 0 の場合、極エラー (pole error) が発生し、
125 各関数はそれぞれ
126 .RB - HUGE_VAL ,
127 .RB - HUGE_VALF ,
128 .RB - HUGE_VALL
129 を返す。
130
131 .\"O If
132 .\"O .I x
133 .\"O is negative (including negative infinity), then
134 .\"O a domain error occurs, and a NaN (not a number) is returned.
135 .I x
136 が負の場合 (負の無限大も含む)、領域エラー (domain error) が発生し、
137 NaN (not a number) が返される。
138 .\"O .SH ERRORS
139 .SH エラー
140 .\"O See
141 .\"O .BR math_error (7)
142 .\"O for information on how to determine whether an error has occurred
143 .\"O when calling these functions.
144 これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は
145 .BR math_error (7)
146 を参照のこと。
147 .PP
148 .\"O The following errors can occur:
149 以下のエラーが発生する可能性がある。
150 .TP
151 .\"O Domain error: \fIx\fP is negative
152 領域エラー (domain error): \fIx\fP が負である
153 .\"O .I errno
154 .\"O is set to
155 .\"O .BR EDOM .
156 .\"O An invalid floating-point exception
157 .\"O .RB ( FE_INVALID )
158 .\"O is raised.
159 .I errno
160
161 .B EDOM
162 が設定される。
163 不正 (invalid) 浮動小数点例外
164 .RB ( FE_INVALID )
165 が上がる。
166 .TP
167 .\"O Pole error: \fIx\fP is zero
168 極エラー (pole error): \fIx\fP が 0 である
169 .\"O .I errno
170 .\"O is set to
171 .\"O .BR ERANGE .
172 .\"O A divide-by-zero floating-point exception
173 .\"O .RB ( FE_DIVBYZERO )
174 .\"O is raised.
175 .I errno
176
177 .B ERANGE
178 が設定される。
179 0 による除算 (divide-by-zero) 浮動小数点例外
180 .RB ( FE_DIVBYZERO )
181 が上がる。
182 .\"O .SH "CONFORMING TO"
183 .SH 準拠
184 C99, POSIX.1-2001.
185 .\"O The variant returning
186 .\"O .I double
187 .\"O also conforms to
188 .\"O SVr4, 4.3BSD, C89.
189 .I double
190 版の関数は SVr4, 4.3BSD, C89 にも準拠している。
191 .\"O .SH BUGS
192 .SH バグ
193 .\"O In glibc 2.5 and earlier,
194 .\"O taking the
195 .\"O .BR log ()
196 .\"O of a NaN produces a bogus invalid floating-point
197 .\"O .RB ( FE_INVALID )
198 .\"O exception.
199 glibc 2.5 以前では、
200 NaN に対して
201 .BR log ()
202 をとると、間違って不正浮動小数点例外
203 .RB ( FE_INVALID )
204 が発生していた。
205 .\"O .SH "SEE ALSO"
206 .SH 関連項目
207 .BR cbrt (3),
208 .BR clog (3),
209 .BR log10 (3),
210 .BR log1p (3),
211 .BR log2 (3),
212 .BR sqrt (3)