OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[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)