OSDN Git Service

cb3731764918b335e6f9b282e1ec0aae44b56233
[linuxjm/LDP_man-pages.git] / release / man3 / rint.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 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\"*******************************************************************
28 .\"
29 .\" This file was generated with po4a. Translate the source file.
30 .\"
31 .\"*******************************************************************
32 .\"
33 .\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
34 .\" and Copyright (c) 2008 Akihiro MOTOKI
35 .\" Translated Tue Jan 21 20:52:09 JST 1997
36 .\"       by YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
37 .\" Updated & Modified Fri Jul  6 20:42:59 JST 2001
38 .\"       by Yuichi SATO <ysato@h4.dion.ne.jp>
39 .\" Updated & Modified Sun Jan 16 07:40:37 JST 2005
40 .\"       by Yuichi SATO <ysato444@yahoo.co.jp>
41 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
42 .\"
43 .TH RINT 3 2013\-08\-26 "" "Linux Programmer's Manual"
44 .SH 名前
45 nearbyint, nearbyintf, nearbyintl, rint, rintf, rintl \- 最も近い整数に丸める
46 .SH 書式
47 .nf
48 \fB#include <math.h>\fP
49 .sp
50 \fBdouble nearbyint(double \fP\fIx\fP\fB);\fP
51 .br
52 \fBfloat nearbyintf(float \fP\fIx\fP\fB);\fP
53 .br
54 \fBlong double nearbyintl(long double \fP\fIx\fP\fB);\fP
55 .sp
56 \fBdouble rint(double \fP\fIx\fP\fB);\fP
57 .br
58 \fBfloat rintf(float \fP\fIx\fP\fB);\fP
59 .br
60 \fBlong double rintl(long double \fP\fIx\fP\fB);\fP
61 .fi
62 .sp
63 \fI\-lm\fP でリンクする。
64 .sp
65 .in -4n
66 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
67 .in
68 .sp
69 .ad l
70 \fBnearbyint\fP(), \fBnearbyintf\fP(), \fBnearbyintl\fP():
71 .RS 4
72 _XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L ||
73 _ISOC99_SOURCE;
74 .br
75 or \fIcc\ \-std=c99\fP
76 .RE
77 .br
78 \fBrint\fP():
79 .RS 4
80 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L;
81 .br
82 or \fIcc\ \-std=c99\fP
83 .RE
84 .br
85 \fBrintf\fP(), \fBrintl\fP():
86 .RS 4
87 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
88 || _POSIX_C_SOURCE\ >=\ 200112L;
89 .br
90 or \fIcc\ \-std=c99\fP
91 .RE
92 .ad b
93 .SH 説明
94 The \fBnearbyint\fP(), \fBnearbyintf\fP(), and \fBnearbyintl\fP()  functions round
95 their argument to an integer value in floating\-point format, using the
96 current rounding direction (see \fBfesetround\fP(3))  and without raising the
97 \fIinexact\fP exception.
98 .LP
99 The \fBrint\fP(), \fBrintf\fP(), and \fBrintl\fP()  functions do the same, but will
100 raise the \fIinexact\fP exception (\fBFE_INEXACT\fP, checkable via
101 \fBfetestexcept\fP(3))  when the result differs in value from the argument.
102 .SH 返り値
103 これらの関数は丸めた整数値を返す。
104
105 \fIx\fP が整数、+0、\-0、NaN、無限のいずれかの場合、 \fIx\fP そのものが返される。
106 .SH エラー
107 エラーは発生しない。 POSIX.1\-2001 にはオーバーフローでの範囲エラー (range error) の 記載がある。「注意」の節を参照のこと。
108 .SH 属性
109 .SS "マルチスレッディング (pthreads(7) 参照)"
110 The \fBnearbyint\fP(), \fBnearbyintf\fP(), \fBnearbyintl\fP(), \fBrint\fP(), \fBrintf\fP(),
111 and \fBrintl\fP()  functions are thread\-safe.
112 .SH 準拠
113 C99, POSIX.1\-2001.
114 .SH 注意
115 SUSv2 と POSIX.1\-2001 にはオーバーフローに関する記述があり、 オーバーフローの場合には、 \fIerrno\fP を \fBERANGE\fP
116 に設定するか、 \fBFE_OVERFLOW\fP 例外を発生することとされている。
117 実際のところ、どの現行のマシンでも結果がオーバーフローを起こすことはないので、 このエラー処理は意味がない。
118 (より正確に言うと、オーバーフローは指数部の最大値が 仮数部を表すビットの数より小さい場合にしか起こらない。 IEEE\-754 規格の 32 ビットと
119 64 ビットの浮動小数では、 指数部の最大値はそれぞれ 128 と 1024 であり、 仮数部のビット数はそれぞれ 24 と 53 である。)
120
121 丸めた値を整数型に格納した場合には、おそらくこの関数ではなく \fBlrint\fP(3)  に載っている関数のどれかを使いたいのだろう。
122 .SH 関連項目
123 \fBceil\fP(3), \fBfloor\fP(3), \fBlrint\fP(3), \fBround\fP(3), \fBtrunc\fP(3)
124 .SH この文書について
125 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
126 である。プロジェクトの説明とバグ報告に関する情報は
127 http://www.kernel.org/doc/man\-pages/ に書かれている。