.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" Distributed under GPL .\" based on glibc infopages .\" polished, aeb .\" .\" Japanese Version Copyright (c) 2005 Yuichi SATO .\" and Copyright (c) 2008 Akihiro MOTOKI .\" Translated Tue Feb 1 06:39:08 JST 2005 .\" by Yuichi SATO .\" Updated 2008-09-16, Akihiro MOTOKI .\" .TH REMQUO 3 2010-09-20 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O remquo, remquof, remquol \- remainder and part of quotient remquo, remquof, remquol \- 商の一部と剰余を求める .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "double remquo(double " x ", double " y ", int *" quo ); .br .BI "float remquof(float " x ", float " y ", int *" quo ); .br .BI "long double remquol(long double " x ", long double " y ", int *" quo ); .fi .sp .\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .ad l .BR remquo (), .BR remquof (), .BR remquol (): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .ad .\"O .SH DESCRIPTION .SH 説明 .\"O These functions compute the remainder and part of the quotient .\"O upon division of .\"O .I x .\"O by .\"O .IR y . これらの関数は .I x を .I y で割ったときの商の一部と剰余を計算する。 .\"O A few bits of the quotient are stored via the .\"O .I quo .\"O pointer. .\"O The remainder is returned as the function result. 商のいくつかのビットが .I quo ポインタを使って格納される。 剰余は関数の結果として返される。 .\"O The value of the remainder is the same as that computed by the .\"O .BR remainder (3) .\"O function. 剰余の値は .BR remainder (3) 関数で計算されるものと同じである。 .\"O The value stored via the .\"O .I quo .\"O pointer has the sign of .\"O .IR "x\ /\ y" .\"O and agrees with the quotient in at least the low order 3 bits. .I quo ポインタを使って格納される値には、 .I "x\ /\ y" の符号と最低でも商の下位 3 ビットが含まれる。 .\"O For example, \fIremquo(29.0,\ 3.0)\fP returns \-1.0 and might store 2. .\"O Note that the actual quotient might not fit in an integer. たとえば \fIremquo(29.0,\ 3.0)\fP は \-1.0 を返し、 (訳注: quo の指しているものには) 2 が格納される。 実際の商が整数値にならない点に注意すること。 .\"O .\" A possible application of this function might be the computation .\"O .\" of sin(x). Compute remquo(x, pi/2, &quo) or so. .\" この関数を利用するアプリケーションとしては、 .\" sin(x) の計算などがあるかもしれない。 .\" sin(x) では remquo(x, pi/2, &quo) などを計算する。 .\" .\"O .\" glibc, UnixWare: return 3 bits .\"O .\" MacOS 10: return 7 bits .\" glibc, UnixWare: 3 ビットを返す。 .\" MacOS 10: 7 ビットを返す。 .\"O .SH RETURN VALUE .SH 返り値 .\"O On success, these functions return the same value as .\"O the analogous functions described in .\"O .BR remainder (3). 成功すると、これらの関数は .BR remainder (3) に書かれている同様の関数と同じ値を返す。 .\"O If .\"O .I x .\"O or .\"O .I y .\"O is a NaN, a NaN is returned. .I x か .I y が NaN の場合、NaN が返される。 .\"O If .\"O .I x .\"O is an infinity, .\"O and .\"O .I y .\"O is not a NaN, .\"O a domain error occurs, and .\"O a NaN is returned. .I x が無限大で .I y が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。 .\"O If .\"O .I y .\"O is zero, .\"O and .\"O .I x .\"O is not a NaN, .\"O a domain error occurs, and .\"O a NaN is returned. .I y がゼロで .I x が NaN でない場合、 領域エラー (domain error) が発生し、NaN が返される。 .\"O .SH ERRORS .SH エラー .\"O See .\"O .BR math_error (7) .\"O for information on how to determine whether an error has occurred .\"O when calling these functions. これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は .BR math_error (7) を参照のこと。 .PP .\"O The following errors can occur: 以下のエラーが発生する可能性がある。 .TP .\"O Domain error: \fIx\fP is an infinity or \fIy\fP is 0, \ .\"O and the other argument is not a NaN 領域エラー (domain error): \fIx\fP が無限大か \fIy\fP が 0 で、 \ 他の引き数が NaN でない .\" .I errno .\" is set to .\" .BR EDOM . .\"O An invalid floating-point exception .\"O .RB ( FE_INVALID ) .\"O is raised. 不正 (invalid) 浮動小数点例外 .RB ( FE_INVALID ) が上がる。 .PP .\"O These functions do not set .\"O .IR errno . これらの関数は .I errno を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6802 .\"O .SH VERSIONS .SH バージョン .\"O These functions first appeared in glibc in version 2.1. これらの関数は glibc バージョン 2.1 で初めて登場した。 .\"O .SH "CONFORMING TO" .SH 準拠 C99, POSIX.1-2001. .\"O .SH "SEE ALSO" .SH 関連項目 .BR fmod (3), .BR logb (3), .BR remainder (3)