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>
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
30 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
31 .\" Modified 2002-08-10 Walter Harms
32 .\" (walter.harms@informatik.uni-oldenburg.de)
33 .\" Modified 2003-11-18, 2004-10-05 aeb
35 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
36 .\" and Copyright (c) 2008 Akihiro MOTOKI
37 .\" Translated 2004-09-02, Yuichi SATO <ysato444@yahoo.co.jp>
38 .\" Updated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
39 .\" Modified 2005-02-26, Yuichi SATO <ysato444@yahoo.co.jp>
40 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
42 .TH REMAINDER 3 2010-09-20 "" "Linux Programmer's Manual"
44 drem, dremf, dreml, remainder, remainderf, remainderl \- 浮動小数点剰余関数
50 .BI "double remainder(double " x ", double " y );
51 .BI "float remainderf(float " x ", float " y );
52 .BI "long double remainderl(long double " x ", long double " y );
55 .BI "double drem(double " x ", double " y );
56 .BI "float dremf(float " x ", float " y );
57 .BI "long double dreml(long double " x ", long double " y );
64 .RB ( feature_test_macros (7)
71 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
72 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED ||
74 _POSIX_C_SOURCE\ >=\ 200112L;
83 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
84 _POSIX_C_SOURCE\ >=\ 200112L;
94 _SVID_SOURCE || _BSD_SOURCE
105 \fIx\fP\-\fIn\fP*\fIy\fP
112 \fIx\fP\-\fIn\fP*\fIy\fP
113 の絶対値が 0.5 の場合、偶数になるように
117 これらの関数は、現在の丸めモードの影響を受けない (丸めモードについては
124 成功すると、これらの関数は浮動小数点の剰余 \fIx\fP\-\fIn\fP*\fIy\fP を返す。
138 領域エラー (domain error) が発生し、NaN が返される。
140 .\" FIXME . Instead, glibc gives a domain error even if x is a NaN
141 .\" Interestingly, remquo(3) does not have the same problem.
148 これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は
154 領域エラー (domain error): \fIx\fP が無限大で \fIy\fP が NaN ではない
165 .\" FIXME . Is it intentional that these functions do not set errno?
166 .\" They do set errno for the y == 0 case, below.
167 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6783
169 領域エラー: \fIy\fP がゼロで \fIx\fP が NaN ではない (下記の「バグ」参照)
183 は C99 と POSIX.1-2001 で規定されている。
195 は、Tru64 や glibc2 のようないくつかのシステムに存在する。
201 remainder(nan(""), 0);
203 の呼び出しを行うと、期待通り Nan が返るが、誤って領域エラーが発生する。
204 正しくはエラーなしの Nan となるべきである。
205 .\" FIXME . this bug occurs as at glibc 2.8.
206 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6779
208 "remainder(29.0, 3.0)" を呼び出すと \-1 を返す。