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 YOSHINO Takashi
26 .\" and Copyright (c) 2008 Akihiro MOTOKI
27 .\" Translated Mon Jan 20 18:35:18 JST 1997
28 .\" by YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
29 .\" Updated & Modified Fri Jul 6 20:37:36 JST 2001
30 .\" by Yuichi SATO <ysato@h4.dion.ne.jp>
31 .\" Updated & Modified Mon Jan 10 08:45:45 JST 2005
32 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
33 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
35 .\"WORD: mantissa ²¾¿ô
37 .TH FLOOR 3 2008-10-06 "" "Linux Programmer's Manual"
40 .\"O floor, floorf, floorl \- largest integral value not greater than argument
41 floor, floorf, floorl \- °ú¤¿ô¤ò±Û¤¨¤Ê¤¤ºÇÂç¤ÎÀ°¿ôÃÍ
47 .BI "double floor(double " x );
49 .BI "float floorf(float " x );
51 .BI "long double floorl(long double " x );
54 .\"O Link with \fI\-lm\fP.
55 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
58 .\"O Feature Test Macro Requirements for glibc (see
59 .\"O .BR feature_test_macros (7)):
60 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
61 .RB ( feature_test_macros (7)
68 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
73 .\"O These functions return the largest integral value that is not greater than
77 ¤è¤êÂ礤¯¤Ê¤¤ºÇÂç¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£
89 .\"O .SH "RETURN VALUE"
91 .\"O These functions return the floor of
95 ¤ò±Û¤¨¤Ê¤¤ºÇ¾®¤ÎÀ°¿ôÃͤòÊÖ¤¹¡£
97 .\"O If \fIx\fP is integral, +0, \-0, NaN, or an infinity,
98 .\"O \fIx\fP itself is returned.
99 \fIx\fP ¤¬À°¿ô¡¢+0¡¢\-0¡¢NaN¡¢Ìµ¸ÂÂç¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¡¢
100 \fIx\fP ¤½¤Î¤â¤Î¤¬ÊÖ¤µ¤ì¤ë¡£
103 .\"O No errors occur.
105 .\"O POSIX.1-2001 documents a range error for overflows, but see NOTES.
106 POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ËÂФ·¤ÆÈÏ°Ï¥¨¥é¡¼¤¬µºÜ¤µ¤ì¤Æ¤¤¤ë¡£
108 .\"O .SH "CONFORMING TO"
111 .\"O The variant returning
113 .\"O also conforms to
114 .\"O SVr4, 4.3BSD, C89.
116 ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£
119 .\"O SUSv2 and POSIX.1-2001 contain text about overflow (which might set
126 SUSv2 ¤È POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ë´Ø¤¹¤ëµ½Ò¤¬¤¢¤ê¡¢
127 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢
133 Îã³°¤òȯÀ¸¤¹¤ë¤³¤È¤È¤µ¤ì¤Æ¤¤¤ë¡£
134 .\"O In practice, the result cannot overflow on any current machine,
135 .\"O so this error-handling stuff is just nonsense.
136 ¼ÂºÝ¤Î¤È¤³¤í¡¢¸½¹Ô¤Î¥Þ¥·¥ó¤Ç¤Ï·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¡¢
137 ¤³¤Î¥¨¥é¡¼½èÍý¤Ï°ÕÌ£¤¬¤Ê¤¤¡£
138 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point.
139 .\"O (More precisely, overflow can happen only when the maximum value
140 .\"O of the exponent is smaller than the number of mantissa bits.
141 .\"O For the IEEE-754 standard 32-bit and 64-bit floating-point numbers
142 .\"O the maximum value of the exponent is 128 (respectively, 1024),
143 .\"O and the number of mantissa bits is 24 (respectively, 53).)
144 (¤è¤êÀµ³Î¤Ë¸À¤¦¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï»Ø¿ôÉô¤ÎºÇÂçÃͤ¬
145 ²¾¿ôÉô¤òɽ¤¹¥Ó¥Ã¥È¤Î¿ô¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤·¤«µ¯¤³¤é¤Ê¤¤¡£
146 IEEE-754 µ¬³Ê¤Î 32 ¥Ó¥Ã¥È¤È 64 ¥Ó¥Ã¥È¤ÎÉâÆ°¾®¿ô¤Ç¤Ï¡¢
147 »Ø¿ôÉô¤ÎºÇÂçÃͤϤ½¤ì¤¾¤ì 128 ¤È 1024 ¤Ç¤¢¤ê¡¢
148 ²¾¿ôÉô¤Î¥Ó¥Ã¥È¿ô¤Ï¤½¤ì¤¾¤ì 24 ¤È 53 ¤Ç¤¢¤ë¡£)