OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / sqrt.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 2002-07-27 by Walter Harms
31 .\"     (walter.harms@informatik.uni-oldenburg.de)
32 .\"
33 .\" Japanese Version Copyright (c) 1996 Kenji Kajiwara
34 .\"         all rights reserved.
35 .\" Translated Mon Jul 15 18:40:00 JST 1996
36 .\"         by Kenji Kajiwara
37 .\" Proof Reading: Takashi Yoshino
38 .\" Updated Sun Sep 14 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
39 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\"
41 .TH SQRT 3  2010-09-20 ""  "Linux Programmer's Manual"
42 .SH Ì¾Á°
43 sqrt, sqrtf, sqrtl \- Ê¿Êýº¬´Ø¿ô
44 .SH ½ñ¼°
45 .nf
46 .B #include <math.h>
47 .sp
48 .BI "double sqrt(double " x );
49 .br
50 .BI "float sqrtf(float " x );
51 .br
52 .BI "long double sqrtl(long double " x );
53 .fi
54 .sp
55 .\"O Link with \fI\-lm\fP.
56 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
57 .sp
58 .in -4n
59 .\"O Feature Test Macro Requirements for glibc (see
60 .\"O .BR feature_test_macros (7)):
61 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
62 .RB ( feature_test_macros (7)
63 »²¾È):
64 .in
65 .sp
66 .ad l
67 .BR sqrtf (),
68 .BR sqrtl ():
69 .RS 4
70 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
71 _POSIX_C_SOURCE\ >=\ 200112L;
72 .br
73 or
74 .I cc\ -std=c99
75 .RE
76 .ad
77 .\"O .SH DESCRIPTION
78 .SH ÀâÌÀ
79 .\"O The
80 .\"O .BR sqrt ()
81 .\"O function returns the nonnegative square root of \fIx\fP.
82 .BR sqrt ()
83 ´Ø¿ô¤Ï \fIx\fP ¤ÎÊ¿Êýº¬¤Î¤¦¤ÁÉé¤Ç¤Ê¤¤Êý¤ÎÃͤòÊÖ¤¹¡£
84 .\"O .SH "RETURN VALUE"
85 .SH ÊÖ¤êÃÍ
86 .\"O On success, these functions return the square root of
87 .\"O .IR x .
88 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï
89 .I x
90 ¤ÎÊ¿Êýº¬¤òÊÖ¤¹¡£
91
92 .\"O If
93 .\"O .I x
94 .\"O is a NaN, a NaN is returned.
95 .I x
96 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
97
98 .\"O If
99 .\"O .I x
100 .\"O is +0 (\-0), +0 (\-0) is returned.
101 .I x
102 ¤¬ +0 (\-0) ¤Î¾ì¹ç¡¢+0 (\-0) ¤¬ÊÖ¤µ¤ì¤ë¡£
103  
104 .\"O If
105 .\"O .I x
106 .\"O is positive infinity, positive infinity is returned.
107 .I x
108 ¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£
109
110 .\"O If
111 .\"O .I x
112 .\"O is less than \-0,
113 .\"O a domain error occurs,
114 .\"O and a NaN is returned.
115 .I x
116 ¤¬ 0 Ì¤Ëþ¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
117 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
118 .\"O .SH ERRORS
119 .SH ¥¨¥é¡¼
120 .\"O See
121 .\"O .BR math_error (7)
122 .\"O for information on how to determine whether an error has occurred
123 .\"O when calling these functions.
124 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
125 .BR math_error (7)
126 ¤ò»²¾È¤Î¤³¤È¡£
127 .PP
128 .\"O The following errors can occur:
129 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
130 .TP
131 .\"O Domain error: \fIx\fP less than \-0
132 Îΰ襨¥é¡¼ (domain error): \fIx\fP ¤¬ 0 Ì¤Ëþ
133 .\"O .I errno
134 .\"O is set to
135 .\"O .BR EDOM .
136 .\"O An invalid floating-point exception
137 .\"O .RB ( FE_INVALID )
138 .\"O is raised.
139 .I errno
140 ¤Ë
141 .B EDOM
142 ¤¬ÀßÄꤵ¤ì¤ë¡£
143 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
144 .RB ( FE_INVALID )
145 ¤¬¾å¤¬¤ë¡£
146 .\"O .SH "CONFORMING TO"
147 .SH ½àµò
148 C99, POSIX.1-2001.
149 .\"O The variant returning
150 .\"O .I double
151 .\"O also conforms to
152 .\"O SVr4, 4.3BSD, C89.
153 .I double
154 ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£
155 .SH ´ØÏ¢¹àÌÜ
156 .BR cbrt (3),
157 .BR csqrt (3),
158 .BR hypot (3)