OSDN Git Service

7aadda0aacbb4367d64e8044e9ed8e12fb5b711a
[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  2008-08-11 "" "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 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
63 .I cc\ -std=c99
64 .ad b
65 .\"O .SH DESCRIPTION
66 .SH ÀâÌÀ
67 .\"O These functions round \fIx\fP to the nearest integer
68 .\"O not larger in absolute value.
69 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÀäÂÐÃͤ¬ \fIx\fP ¤è¤ê¾®¤µ¤¤
70 °ìÈֶᤤÀ°¿ôÃͤˠ\fIx\fP ¤ò´Ý¤á¤ë¡£
71 .\"O .SH "RETURN VALUE"
72 .SH ÊÖ¤êÃÍ
73 .\"O These functions return the rounded integer value.
74 ¤³¤ì¤é¤Î´Ø¿ô¤Ï´Ý¤á¤é¤ì¤¿À°¿ôÃͤòÊÖ¤¹¡£
75
76 .\"O If \fIx\fP is integral, infinite, or NaN, \fIx\fP itself is returned.
77 \fIx\fP ¤¬À°¿ô¡¢Ìµ¸ÂÂç¡¢NaN ¤Î¾ì¹ç¡¢\fIx\fP ¼«¿È¤¬ÊÖ¤µ¤ì¤ë¡£
78 .\"O .SH ERRORS
79 .SH ¥¨¥é¡¼
80 .\"O No errors occur.
81 ¥¨¥é¡¼¤ÏȯÀ¸¤·¤Ê¤¤¡£
82 .\"O .SH VERSIONS
83 .SH ¥Ð¡¼¥¸¥ç¥ó
84 .\"O These functions first appeared in glibc in version 2.1.
85 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
86 .\"O .SH "CONFORMING TO"
87 .SH ½àµò
88 C99, POSIX.1-2001.
89 .\"O .SH NOTES
90 .SH Ãí°Õ
91 .\"O The integral value returned by these functions may be too large
92 .\"O to store in an integer type
93 .\"O .RI ( int ,
94 .\"O .IR long ,
95 .\"O etc.).
96 .\"O To avoid an overflow, which will produce undefined results,
97 .\"O an application should perform a range check on the returned value
98 .\"O before assigning it to an integer type.
99 ¤³¤ì¤é¤Î´Ø¿ô¤¬ÊÖ¤¹À°¿ôÃͤÏÀ°¿ô·¿
100 .RI ( int ,
101 .I long
102 ¤Ê¤É) ¤Ë³ÊǼ¤¹¤ë¤Ë¤ÏÂ礭²á¤®¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
103 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¤Î·ë²Ì¤Ïʬ¤«¤é¤Ê¤¤¤Î¤Ç¡¢
104 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤òÈò¤±¤ë¤¿¤á¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÀ°¿ô·¿¤ËÂåÆþ¤¹¤ëÁ°¤Ë
105 ÊÖ¤µ¤ì¤¿ÃͤÎÈϰϳÎǧ¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¢¤ë¡£
106 .\"O .SH "SEE ALSO"
107 .SH ´ØÏ¢¹àÌÜ
108 .BR ceil (3),
109 .BR floor (3),
110 .BR lrint (3),
111 .BR nearbyint (3),
112 .BR rint (3),
113 .BR round (3)