1 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
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.
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.
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
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
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>
35 .\"WORD: mantissa ²¾¿ô
37 .TH CEIL 3 2010-09-20 "" "Linux Programmer's Manual"
40 .\"O ceil, ceilf, ceill \- ceiling function: smallest integral value not
41 .\"O less than argument
42 ceil, ceilf, ceill \- °ú¤¿ô¤ò²¼²ó¤é¤Ê¤¤ºÇ¾®¤ÎÀ°¿ôÃÍ
48 .BI "double ceil(double " x );
50 .BI "float ceilf(float " x );
52 .BI "long double ceill(long double " x );
55 .\"O Link with \fI\-lm\fP.
56 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
59 .\"O Feature Test Macro Requirements for glibc (see
60 .\"O .BR feature_test_macros (7)):
61 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
62 .RB ( feature_test_macros (7)
70 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
71 _POSIX_C_SOURCE\ >=\ 200112L;
79 .\"O These functions return the smallest integral value that is not less than
81 ¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP ¤è¤ê¾®¤µ¤¯¤Ê¤¤ºÇ¾®¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£
93 .\"O .SH "RETURN VALUE"
95 .\"O These functions return the ceiling of
99 ¤ò²¼²ó¤é¤Ê¤¤À°¿ôÃͤòÊÖ¤¹¡£
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 ¤½¤Î¤â¤Î¤òÊÖ¤¹¡£
107 .\"O No errors occur.
109 .\"O POSIX.1-2001 documents a range error for overflows, but see NOTES.
110 POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ËÂФ·¤ÆÈÏ°Ï¥¨¥é¡¼¤¬µºÜ¤µ¤ì¤Æ¤¤¤ë¡£
112 .\"O .SH "CONFORMING TO"
115 .\"O The variant returning
117 .\"O also conforms to
118 .\"O SVr4, 4.3BSD, C89.
120 ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£
123 .\"O SUSv2 and POSIX.1-2001 contain text about overflow (which might set
130 SUSv2 ¤È POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ë´Ø¤¹¤ëµ½Ò¤¬¤¢¤ê¡¢
131 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ÎºÝ¤Ë¤Ï
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 ¤Ç¤¢¤ë¡£)
154 .\"O The integral value returned by these functions may be too large
155 .\"O to store in an integer type
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 ¤³¤ì¤é¤Î´Ø¿ô¤¬ÊÖ¤¹À°¿ôÃͤÏÀ°¿ô·¿
165 ¤Ê¤É) ¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÂ礲᤮¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
166 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ïʬ¤«¤é¤Ê¤¤¤Î¤Ç¡¢
167 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òÈò¤±¤ë¤¿¤á¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÀ°¿ô·¿¤ËÂåÆþ¤¹¤ëÁ°¤Ë
168 ÊÖ¤µ¤ì¤¿ÃͤÎÈϰϳÎǧ¤ò¼Â¹Ô¤¹¤Ù¤¤Ç¤¢¤ë¡£