OSDN Git Service

(split) Fixed #25191 (typo in fenv.3).
[linuxjm/LDP_man-pages.git] / release / man3 / round.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) 2001, 2005 Yuichi SATO
26 .\" and Copyright (c) 2008 Akihiro MOTOKI
27 .\" Translated Fri Jul 13 20:33:41 JST 2001
28 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
29 .\" Updated & Modified Sun Jan 16 07:59:12 JST 2005
30 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
31 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
32 .\"
33 .\"WORD:        mantissa        ²¾¿ô
34 .\"
35 .TH ROUND 3  2010-09-20 "" "Linux Programmer's Manual"
36 .SH Ì¾Á°
37 round, roundf, roundl \- ºÇ¤â¶á¤¤À°¿ôÃͤ˴ݤá¤ë (2 ¤Ä¤ÎÀ°¿ô¤ÎÃæ´ÖÃͤξì¹ç¤Ï 0 ¤«¤é±ó¤¤Êý¤Ë´Ý¤á¤ë)
38 .SH ½ñ¼°
39 .nf
40 .B #include <math.h>
41 .sp
42 .BI "double round(double " x );
43 .br
44 .BI "float roundf(float " x );
45 .br
46 .BI "long double roundl(long double " x );
47 .fi
48 .sp
49 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
50 .sp
51 .in -4n
52 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
53 .RB ( feature_test_macros (7)
54 »²¾È):
55 .in
56 .sp
57 .ad l
58 .BR round (),
59 .BR roundf (),
60 .BR roundl ():
61 .RS 4
62 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
63 _POSIX_C_SOURCE\ >=\ 200112L;
64 .br
65 or
66 .I cc\ -std=c99
67 .RE
68 .ad
69 .SH ÀâÌÀ
70 ¤³¤ì¤é¤Î´Ø¿ô¤Ï \fIx\fP ¤òºÇ¤â¶á¤¤À°¿ôÃͤ˴ݤá¤ë¡£
71 2 ¤Ä¤ÎÀ°¿ô¤ÎÃæ´ÖÃͤξì¹ç¤Ï¡¢
72 .BR rint (3)
73 ¤Î¤è¤¦¤ËºÇ¤â¶á¤¤¶ö¿ô¤Ë´Ý¤á¤¿¤ê¤»¤º¤Ë¡¢
74 (¸½ºß¤Î´Ý¤áÊý¸þ¤Ë´Ø·¸¤Ê¤¯) 0 ¤«¤é±ó¤¤Êý¤Ë´Ý¤á¤ë
75 (´Ý¤áÊý¸þ¤Ë¤Ä¤¤¤Æ¤Ï
76 .BR fenv (3)
77 ¤ò»²¾È)¡£
78
79 Î㤨¤Ð¡¢
80 .I round(0.5)
81 ¤Ï 1.0 ¤Ç¡¢
82 .I round(\-0.5)
83 ¤Ï \-1.0 ¤Ç¤¢¤ë¡£
84 .SH ÊÖ¤êÃÍ
85 ¤³¤ì¤é¤Î´Ø¿ô¤Ï´Ý¤á¤¿À°¿ôÃͤòÊÖ¤¹¡£
86
87 \fIx\fP ¤¬À°¿ô¡¢+0¡¢\-0¡¢NaN¡¢Ìµ¸Â¤Î¤¤¤º¤ì¤«¤Î¾ì¹ç¡¢
88 \fIx\fP ¤½¤Î¤â¤Î¤¬ÊÖ¤µ¤ì¤ë¡£
89 .SH ¥¨¥é¡¼
90 ¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£
91 POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ç¤ÎÈÏ°Ï¥¨¥é¡¼ (range error) ¤Î
92 µ­ºÜ¤¬¤¢¤ë¡£¡ÖÃí°Õ¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£
93 .SH ¥Ð¡¼¥¸¥ç¥ó
94 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
95 .SH ½àµò
96 C99, POSIX.1-2001.
97 .SH Ãí°Õ
98 POSIX.1-2001 ¤Ë¤Ï¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ë´Ø¤¹¤ëµ­½Ò¤¬¤¢¤ê¡¢
99 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Î¾ì¹ç¤Ë¤Ï¡¢
100 .I errno
101 ¤ò
102 .B ERANGE
103 ¤ËÀßÄꤹ¤ë¤«¡¢
104 .B FE_OVERFLOW
105 Îã³°¤òȯÀ¸¤¹¤ë¤³¤È¤È¤µ¤ì¤Æ¤¤¤ë¡£
106 ¼ÂºÝ¤Î¤È¤³¤í¡¢¤É¤Î¸½¹Ô¤Î¥Þ¥·¥ó¤Ç¤Ï·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òµ¯¤³¤¹¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¡¢
107 ¤³¤Î¥¨¥é¡¼½èÍý¤Ï°ÕÌ£¤¬¤Ê¤¤¡£
108 .\" The POSIX.1-2001 APPLICATION USAGE SECTION discusses this point.
109 (¤è¤êÀµ³Î¤Ë¸À¤¦¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤Ï»Ø¿ôÉô¤ÎºÇÂçÃͤ¬
110 ²¾¿ôÉô¤òɽ¤¹¥Ó¥Ã¥È¤Î¿ô¤è¤ê¾®¤µ¤¤¾ì¹ç¤Ë¤·¤«µ¯¤³¤é¤Ê¤¤¡£
111 IEEE-754 µ¬³Ê¤Î 32 ¥Ó¥Ã¥È¤È 64 ¥Ó¥Ã¥È¤ÎÉâÆ°¾®¿ô¤Ç¤Ï¡¢
112 »Ø¿ôÉô¤ÎºÇÂçÃͤϤ½¤ì¤¾¤ì 128 ¤È 1024 ¤Ç¤¢¤ê¡¢
113 ²¾¿ôÉô¤Î¥Ó¥Ã¥È¿ô¤Ï¤½¤ì¤¾¤ì 24 ¤È 53 ¤Ç¤¢¤ë¡£)
114
115 ´Ý¤á¤¿ÃͤòÀ°¿ô·¿¤Ë³ÊǼ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤ª¤½¤é¤¯¤³¤Î´Ø¿ô¤Ç¤Ï¤Ê¤¯
116 .BR lround (3)
117 ¤ËºÜ¤Ã¤Æ¤¤¤ë´Ø¿ô¤Î¤É¤ì¤«¤ò»È¤¤¤¿¤¤¤Î¤À¤í¤¦¡£
118 .SH ´ØÏ¢¹àÌÜ
119 .BR ceil (3),
120 .BR floor (3),
121 .BR lround (3),
122 .BR nearbyint (3),
123 .BR rint (3),
124 .BR trunc (3)