OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[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 .\"*******************************************************************
24 .\"
25 .\" This file was generated with po4a. Translate the source file.
26 .\"
27 .\"*******************************************************************
28 .TH TRUNC 3 2010\-09\-20 "" "Linux Programmer's Manual"
29 .SH 名前
30 trunc, truncf, truncl \- 0 に近い方の整数値に丸める
31 .SH 書式
32 .nf
33 \fB#include <math.h>\fP
34 .sp
35 \fBdouble trunc(double \fP\fIx\fP\fB);\fP
36 .br
37 \fBfloat truncf(float \fP\fIx\fP\fB);\fP
38 .br
39 \fBlong double truncl(long double \fP\fIx\fP\fB);\fP
40 .fi
41 .sp
42 \fI\-lm\fP でリンクする。
43 .sp
44 .in -4n
45 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
46 .in
47 .sp
48 .ad l
49 \fBtrunc\fP(), \fBtruncf\fP(), \fBtruncl\fP():
50 .RS 4
51 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L;
52 .br
53 or \fIcc\ \-std=c99\fP
54 .RE
55 .ad
56 .SH 説明
57 これらの関数は絶対値が \fIx\fP より小さい 一番近い整数値に \fIx\fP を丸める。
58 .SH 返り値
59 これらの関数は丸めた整数値を返す。
60
61 \fIx\fP が整数、無限大、NaN の場合、\fIx\fP 自身が返される。
62 .SH エラー
63 エラーは発生しない。
64 .SH バージョン
65 これらの関数は glibc バージョン 2.1 で初めて登場した。
66 .SH 準拠
67 C99, POSIX.1\-2001.
68 .SH 注意
69 これらの関数が返す整数値は整数型 (\fIint\fP, \fIlong\fP など) に格納するには大き過ぎるかもしれない。
70 オーバーフローが起こった場合の結果は分からないので、 オーバーフローを避けるため、アプリケーションでは整数型に代入する前に
71 返された値の範囲確認を実行すべきである。
72 .SH 関連項目
73 \fBceil\fP(3), \fBfloor\fP(3), \fBlrint\fP(3), \fBnearbyint\fP(3), \fBrint\fP(3),
74 \fBround\fP(3)