OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / 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 .SH 名前
32 trunc, truncf, truncl \- 0 に近い方の整数値に丸める
33 .SH 書式
34 .nf
35 .B #include <math.h>
36 .sp
37 .BI "double trunc(double " x );
38 .br
39 .BI "float truncf(float " x );
40 .br
41 .BI "long double truncl(long double " x );
42 .fi
43 .sp
44 \fI\-lm\fP でリンクする。
45 .sp
46 .in -4n
47 glibc 向けの機能検査マクロの要件
48 .RB ( feature_test_macros (7)
49 参照):
50 .in
51 .sp
52 .ad l
53 .BR trunc (),
54 .BR truncf (),
55 .BR truncl ():
56 .RS 4
57 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
58 _POSIX_C_SOURCE\ >=\ 200112L;
59 .br
60 or
61 .I cc\ -std=c99
62 .RE
63 .ad
64 .SH 説明
65 これらの関数は絶対値が \fIx\fP より小さい
66 一番近い整数値に \fIx\fP を丸める。
67 .SH 返り値
68 これらの関数は丸められた整数値を返す。
69
70 \fIx\fP が整数、無限大、NaN の場合、\fIx\fP 自身が返される。
71 .SH エラー
72 エラーは発生しない。
73 .SH バージョン
74 これらの関数は glibc バージョン 2.1 で初めて登場した。
75 .SH 準拠
76 C99, POSIX.1-2001.
77 .SH 注意
78 これらの関数が返す整数値は整数型
79 .RI ( int ,
80 .I long
81 など) に格納するには大き過ぎるかもしれない。
82 オーバーフローが起こった場合の結果は分からないので、
83 オーバーフローを避けるため、アプリケーションでは整数型に代入する前に
84 返された値の範囲確認を実行すべきである。
85 .SH 関連項目
86 .BR ceil (3),
87 .BR floor (3),
88 .BR lrint (3),
89 .BR nearbyint (3),
90 .BR rint (3),
91 .BR round (3)