OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / draft / man3 / ceil.3
1 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
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 .\" Japanese Version Copyright (c) 1997 Ueyama Rui
26 .\"         all rights reserved.
27 .\" Translated Tue Feb 21 0:47:30 JST 1997
28 .\"         by Ueyama Rui <ueyama@campusnet.or.jp>
29 .\" Updated & Modified Fri Jul  6 20:35:28 JST 2001
30 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
31 .\" Updated & Modified Sun Jan  9 23:39:35 JST 2005
32 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
33 .\" Updated 2008-09-15, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
34 .\"
35 .\"WORD:        mantissa        仮数
36 .\"
37 .TH CEIL 3  2010-09-20 "" "Linux Programmer's Manual"
38 .\"O .SH NAME
39 .SH 名前
40 .\"O ceil, ceilf, ceill \- ceiling function: smallest integral value not
41 .\"O less than argument
42 ceil, ceilf, ceill \- 引き数を下回らない最小の整数値
43 .\"O .SH SYNOPSIS
44 .SH 書式
45 .nf
46 .B #include <math.h>
47 .sp
48 .BI "double ceil(double " x );
49 .br
50 .BI "float ceilf(float " x );
51 .br
52 .BI "long double ceill(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 ceilf (),
68 .BR ceill ():
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 These functions return the smallest integral value that is not less than
80 .\"O .IR x .
81 これらの関数は \fIx\fP より小さくない最小の整数値を返す。
82
83 .\"O For example,
84 .\"O .IR ceil(0.5)
85 .\"O is 1.0, and
86 .\"O .IR ceil(\-0.5)
87 .\"O is 0.0.
88 例えば、
89 .I ceil(0.5)
90 は 1.0 であり、
91 .I ceil(\-0.5)
92 は 0.0 である。
93 .\"O .SH "RETURN VALUE"
94 .SH 返り値
95 .\"O These functions return the ceiling of
96 .\"O .IR x .
97 これらの関数は
98 .I x
99 を下回らない整数値を返す。
100
101 .\"O If \fIx\fP is integral, +0, \-0, NaN, or infinite,
102 .\"O \fIx\fP itself is returned.
103 \fIx\fP が整数、+0、\-0、NaN、無限のいずれかの場合、
104 \fIx\fP そのものを返す。
105 .\"O .SH ERRORS
106 .SH エラー
107 .\"O No errors occur.
108 エラーは発生しない。
109 .\"O POSIX.1-2001 documents a range error for overflows, but see NOTES.
110 POSIX.1-2001 にはオーバーフローに対して範囲エラーが記載されている。
111 「注意」の節を参照。
112 .\"O .SH "CONFORMING TO"
113 .SH 準拠
114 C99, POSIX.1-2001.
115 .\"O The variant returning
116 .\"O .I double
117 .\"O also conforms to
118 .\"O SVr4, 4.3BSD, C89.
119 .I double
120 版の関数は SVr4, 4.3BSD, C89 にも準拠している。
121 .\"O .SH NOTES
122 .SH 注意
123 .\"O SUSv2 and POSIX.1-2001 contain text about overflow (which might set
124 .\"O .I errno
125 .\"O to
126 .\"O .BR ERANGE ,
127 .\"O or raise an
128 .\"O .B FE_OVERFLOW
129 .\"O exception).
130 SUSv2 と POSIX.1-2001 にはオーバーフローに関する記述があり、
131 オーバーフローの際には
132 .I errno
133
134 .B ERANGE
135 に設定するか
136 .B FE_OVERFLOW
137 例外を起こすとなっている。
138 .\"O In practice, the result cannot overflow on any current machine,
139 .\"O so this error-handling stuff is just nonsense.
140 実際のところ、どの現行のマシンでも結果がオーバーフローを起こすことは
141 ないので、このエラー処理は意味がない。
142 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point.
143 .\"O (More precisely, overflow can happen only when the maximum value
144 .\"O of the exponent is smaller than the number of mantissa bits.
145 .\"O For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
146 .\"O the maximum value of the exponent is 128 (respectively, 1024),
147 .\"O and the number of mantissa bits is 24 (respectively, 53).)
148 (より正確に言うと、オーバーフローは指数部の最大値が
149 仮数部を表すビットの数より小さい場合にしか起こらない。
150 IEEE-754 規格の 32 ビットと 64 ビットの浮動小数では、
151 指数部の最大値はそれぞれ 128 と 1024 であり、
152 仮数部のビット数はそれぞれ 24 と 53 である。)
153
154 .\"O The integral value returned by these functions may be too large
155 .\"O to store in an integer type
156 .\"O .RI ( int ,
157 .\"O .IR long ,
158 .\"O etc.).
159 .\"O To avoid an overflow, which will produce undefined results,
160 .\"O an application should perform a range check on the returned value
161 .\"O before assigning it to an integer type.
162 これらの関数が返す整数値は整数型
163 .RI ( int ,
164 .I long
165 など) に格納するには大き過ぎるかもしれない。
166 オーバーフローが起こった場合の結果は分からないので、
167 オーバーフローを避けるため、アプリケーションでは整数型に代入する前に
168 返された値の範囲確認を実行すべきである。
169 .\"O .SH "SEE ALSO"
170 .SH 関連項目
171 .BR floor (3),
172 .BR lrint (3),
173 .BR nearbyint (3),
174 .BR rint (3),
175 .BR round (3),
176 .BR trunc (3)