OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / trunc.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>.
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2001, 2005 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated Sun Jul  8 10:40:20 JST 2001
26 .\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
27 .\" Updated & Modified Sun Jan 16 08:20:45 JST 2005
28 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
29 .\"
30 .TH TRUNC 3  2010-09-20 "" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .SH Ì¾Á°
33 .\"O trunc, truncf, truncl \- round to integer, towards zero
34 trunc, truncf, truncl \- 0 ¤Ë¶á¤¤Êý¤ÎÀ°¿ôÃͤ˴ݤá¤ë
35 .\"O .SH SYNOPSIS
36 .SH ½ñ¼°
37 .nf
38 .B #include <math.h>
39 .sp
40 .BI "double trunc(double " x );
41 .br
42 .BI "float truncf(float " x );
43 .br
44 .BI "long double truncl(long double " x );
45 .fi
46 .sp
47 .\"O Link with \fI\-lm\fP.
48 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
49 .sp
50 .in -4n
51 .\"O Feature Test Macro Requirements for glibc (see
52 .\"O .BR feature_test_macros (7)):
53 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
54 .RB ( feature_test_macros (7)
55 »²¾È):
56 .in
57 .sp
58 .ad l
59 .BR trunc (),
60 .BR truncf (),
61 .BR truncl ():
62 .RS 4
63 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
64 _POSIX_C_SOURCE\ >=\ 200112L;
65 .br
66 or
67 .I cc\ -std=c99
68 .RE
69 .ad
70 .\"O .SH DESCRIPTION
71 .SH ÀâÌÀ
72 .\"O These functions round \fIx\fP to the nearest integer
73 .\"O not larger in absolute value.
74 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÀäÂÐÃͤ¬ \fIx\fP ¤è¤ê¾®¤µ¤¤
75 °ìÈֶᤤÀ°¿ôÃͤˠ\fIx\fP ¤ò´Ý¤á¤ë¡£
76 .\"O .SH "RETURN VALUE"
77 .SH ÊÖ¤êÃÍ
78 .\"O These functions return the rounded integer value.
79 ¤³¤ì¤é¤Î´Ø¿ô¤Ï´Ý¤á¤é¤ì¤¿À°¿ôÃͤòÊÖ¤¹¡£
80
81 .\"O If \fIx\fP is integral, infinite, or NaN, \fIx\fP itself is returned.
82 \fIx\fP ¤¬À°¿ô¡¢Ìµ¸ÂÂç¡¢NaN ¤Î¾ì¹ç¡¢\fIx\fP ¼«¿È¤¬ÊÖ¤µ¤ì¤ë¡£
83 .\"O .SH ERRORS
84 .SH ¥¨¥é¡¼
85 .\"O No errors occur.
86 ¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£
87 .\"O .SH VERSIONS
88 .SH ¥Ð¡¼¥¸¥ç¥ó
89 .\"O These functions first appeared in glibc in version 2.1.
90 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
91 .\"O .SH "CONFORMING TO"
92 .SH ½àµò
93 C99, POSIX.1-2001.
94 .\"O .SH NOTES
95 .SH Ãí°Õ
96 .\"O The integral value returned by these functions may be too large
97 .\"O to store in an integer type
98 .\"O .RI ( int ,
99 .\"O .IR long ,
100 .\"O etc.).
101 .\"O To avoid an overflow, which will produce undefined results,
102 .\"O an application should perform a range check on the returned value
103 .\"O before assigning it to an integer type.
104 ¤³¤ì¤é¤Î´Ø¿ô¤¬ÊÖ¤¹À°¿ôÃͤÏÀ°¿ô·¿
105 .RI ( int ,
106 .I long
107 ¤Ê¤É) ¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÂ礭²á¤®¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
108 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ïʬ¤«¤é¤Ê¤¤¤Î¤Ç¡¢
109 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òÈò¤±¤ë¤¿¤á¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÀ°¿ô·¿¤ËÂåÆþ¤¹¤ëÁ°¤Ë
110 ÊÖ¤µ¤ì¤¿ÃͤÎÈϰϳÎǧ¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¢¤ë¡£
111 .\"O .SH "SEE ALSO"
112 .SH ´ØÏ¢¹àÌÜ
113 .BR ceil (3),
114 .BR floor (3),
115 .BR lrint (3),
116 .BR nearbyint (3),
117 .BR rint (3),
118 .BR round (3)