OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / draft / man3 / remainder.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
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 .\" References consulted:
28 .\"     Linux libc source code
29 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
30 .\"     386BSD man pages
31 .\"
32 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
33 .\" Modified 2002-08-10 Walter Harms
34 .\"     (walter.harms@informatik.uni-oldenburg.de)
35 .\" Modified 2003-11-18, 2004-10-05 aeb
36 .\"
37 .\"*******************************************************************
38 .\"
39 .\" This file was generated with po4a. Translate the source file.
40 .\"
41 .\"*******************************************************************
42 .\"
43 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
44 .\" and Copyright (c) 2008 Akihiro MOTOKI
45 .\" Translated 2004-09-02, Yuichi SATO <ysato444@yahoo.co.jp>
46 .\" Updated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
47 .\" Modified 2005-02-26, Yuichi SATO <ysato444@yahoo.co.jp>
48 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
49 .\"
50 .TH REMAINDER 3 2010\-09\-20 "" "Linux Programmer's Manual"
51 .SH 名前
52 drem, dremf, dreml, remainder, remainderf, remainderl \- 浮動小数点剰余関数
53 .SH 書式
54 .nf
55 \fB#include <math.h>\fP
56 .sp
57 /* C99 版 */
58 \fBdouble remainder(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP
59 \fBfloat remainderf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP
60 \fBlong double remainderl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP
61 .sp
62 /* 廃止された別名 */
63 \fBdouble drem(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP
64 \fBfloat dremf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP
65 \fBlong double dreml(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP
66 .sp
67 .fi
68 \fI\-lm\fP でリンクする。
69 .sp
70 .in -4n
71 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
72 .in
73 .sp
74 .ad l
75 \fBremainder\fP():
76 .RS 4
77 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L;
78 .br
79 or \fIcc\ \-std=c99\fP
80 .RE
81 .br
82 \fBremainderf\fP(), \fBremainderl\fP():
83 .RS 4
84 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
85 || _POSIX_C_SOURCE\ >=\ 200112L;
86 .br
87 or \fIcc\ \-std=c99\fP
88 .RE
89 .br
90 \fBdrem\fP(), \fBdremf\fP(), \fBdreml\fP():
91 .RS 4
92 _SVID_SOURCE || _BSD_SOURCE
93 .RE
94 .ad b
95 .SH 説明
96 \fBremainder\fP()  関数は \fIx\fP を \fIy\fP で割った余りを計算する。 返り値は \fIx\fP\-\fIn\fP*\fIy\fP である。 ここで
97 \fIn\fP は \fIx\ /\ y\fP の値を最も近い整数に丸めたものである。 \fIx\fP\-\fIn\fP*\fIy\fP の絶対値が 0.5 の場合、偶数になるように
98 \fIn\fP が選ばれる。
99
100 これらの関数は、現在の丸めモードの影響を受けない (丸めモードについては \fBfenv\fP(3)  を参照)。
101 .LP
102 \fBdrem\fP()  関数はこれと全く同じ動作をする。
103 .SH 返り値
104 成功すると、これらの関数は浮動小数点の剰余 \fIx\fP\-\fIn\fP*\fIy\fP を返す。 返り値が 0 の場合、その符号は \fIx\fP と同じになる。
105
106 \fIx\fP か \fIy\fP が NaN の場合、NaN が返される。
107
108 \fIx\fP が無限大で \fIy\fP が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。
109
110 .\" FIXME . Instead, glibc gives a domain error even if x is a NaN
111 .\" Interestingly, remquo(3) does not have the same problem.
112 \fIy\fP がゼロで \fIx\fP が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。
113 .SH エラー
114 これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7)  を参照のこと。
115 .PP
116 以下のエラーが発生する可能性がある。
117 .TP 
118 領域エラー (domain error): \fIx\fP が無限大で \fIy\fP が NaN ではない
119 .\" .I errno
120 .\" is set to
121 .\" .BR EDOM .
122 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP)  が上がる。
123 .IP
124 .\" FIXME . Is it intentional that these functions do not set errno?
125 .\" They do set errno for the y == 0 case, below.
126 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6783
127 これらの関数は、この場合に \fIerrno\fP を設定しない。
128 .TP 
129 .\" [XXX see bug above] and \fIx\fP is not a NaN
130 領域エラー: \fIy\fP がゼロ
131 \fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP)  が上がる。
132 .SH 準拠
133 .\" IEC 60559.
134 関数 \fBremainder\fP(), \fBremainderf\fP(), \fBremainderl\fP()  は C99 と POSIX.1\-2001
135 で規定されている。
136
137 関数 \fBdrem\fP()  は 4.3BSD に由来する。 \fIfloat\fP と \fIlong double\fP 版の \fBdremf\fP()  と
138 \fBdreml\fP()  は、Tru64 や glibc2 のようないくつかのシステムに存在する。 これらの関数の使用は避けて、
139 \fBremainder\fP()  などを使用すること。
140 .SH バグ
141 呼び出し
142
143     remainder(nan(""), 0);
144
145 .\" FIXME . this bug occurs as at glibc 2.8.
146 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6779
147 を行うと、期待通り Nan が返るが、誤って領域エラーが発生する。 正しくはエラーなしの Nan となるべきである。
148 .SH 例
149 "remainder(29.0, 3.0)" を呼び出すと \-1 を返す。
150 .SH 関連項目
151 \fBdiv\fP(3), \fBfmod\fP(3), \fBremquo\fP(3)
152 .SH この文書について
153 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
154 である。プロジェクトの説明とバグ報告に関する情報は
155 http://www.kernel.org/doc/man\-pages/ に書かれている。