.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" Distributed under GPL, 2002-07-27 Walter Harms .\" Modified 2004-11-15, Added further text on FLT_ROUNDS .\" as suggested by AEB and Fabian Kreutz .\" .\" Japanese Version Copyright (c) 2004-2005 Yuichi SATO .\" and Copyright (c) 2008 Akihiro MOTOKI .\" Translated Sat Jul 24 10:37:53 JST 2004 .\" by Yuichi SATO .\" Updated & Modified Mon Jan 10 09:11:49 JST 2005 by Yuichi SATO .\" Updated 2008-09-16, Akihiro MOTOKI .\" .TH FMA 3 2010-09-20 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O fma, fmaf, fmal \- floating-point multiply and add fma, fmaf, fmal \- 浮動小数点数の積と和を計算する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "double fma(double " x ", double " y ", double " z ); .br .BI "float fmaf(float " x ", float " y ", float " z ); .br .BI "long double fmal(long double " x ", long double " y ", long double " z ); .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 fma (), .BR fmaf (), .BR fmal (): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .ad .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR fma () .\"O function computes .\"O .IR x " * " y " + " z . .BR fma () 関数は .IR x " * " y " + " z を計算する。 .\"O The result is rounded as one ternary operation according to the .\"O current rounding mode (see .\"O .BR fenv (3)). 結果は、一つの三項演算として現在の丸めモードにしたがって丸められる .RB ( fenv (3) 参照)。 .\"O .SH RETURN VALUE .SH 返り値 .\"O These functions return the value of .\"O .IR x " * " y " + " z , .\"O rounded as one ternary operation. これらの関数は .IR x " * " y " + " z の、一つの三項演算として丸められた値を返す。 .\"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 times .\"O .I y .\"O is an exact infinity, and .\"O .I z .\"O is an infinity with the opposite sign, .\"O a domain error occurs, .\"O and a NaN is returned. .I y の .I x 倍がちょうど無限大で、 .I z がそれとは反対の符号の無限大の場合、 領域エラー (domain error) が発生し、NaN が返される。 .\" POSIX.1-2008 allows some possible differences for the following two .\" domain error cases, but on Linux they are treated the same (AFAICS). .\" Nevertheless, we'll mirror POSIX.1 and describe the two cases .\" separately. .\"O If one of .\"O .I x .\"O or .\"O .I y .\"O is an infinity, the other is 0, and .\"O .I z .\"O is not a NaN, .\"O a domain error occurs, and .\"O a NaN is returned. .I x と .I y のうち一方が無限大で、もう一方が 0 で、 .I z が NaN でない場合、領域エラーが発生し、NaN が返される。 .\" POSIX.1 says that a NaN or an implementation-defined value shall .\" be returned for this case. .\"O If one of .\"O .I x .\"O or .\"O .I y .\"O is an infinity, and the other is 0, and .\"O .I z .\"O is a NaN, .\" POSIX.1 makes the domain error optional for this case. .\"O a domain error occurs, and .\"O a NaN is returned. .I x と .I y のうち一方が無限大で、もう一方が 0 で、 .I z が NaN の場合、領域エラーが発生し、NaN が返される。 .\"O If .\"O .I x .\"O times .\"O .I y .\"O is not an infinity times zero (or vice versa), and .\"O .I z .\"O is a NaN, .\"O a NaN is returned. .I y の .I x 倍が 0 の無限大倍 (もしくはその逆) ではなく、 .I z が NaN の場合、NaN が返される。 .\"O If the result overflows, .\"O a range error occurs, and .\"O an infinity with the correct sign is returned. 結果がオーバーフローする場合、範囲エラー (range error) が発生し、 正しい符号の無限大が返される。 .\"O If the result underflows, .\"O a range error occurs, and .\"O a signed 0 is returned. 結果がアンダーフローする場合、 範囲エラーが発生し、符号付きの 0 が返される。 .\"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 * \fIy\fP + \fIz\fP, \ .\"O or \fIx\fP * \fIy\fP is invalid and \fIz\fP is not a NaN 領域エラー: \fIx\fP * \fIy\fP + \fIz\fP か \ \fIx\fP * \fIy\fP が無効で、\fIz\fP が 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 ) が上がる。 .TP .\"O Range error: result overflow 範囲エラー: 結果のオーバーフロー .\" .I errno .\" is set to .\" .BR ERANGE . .\"O An overflow floating-point exception .\"O .RB ( FE_OVERFLOW ) .\"O is raised. オーバーフロー浮動小数点例外 .RB ( FE_OVERFLOW ) が上がる。 .TP .\"O Range error: result underflow 範囲エラー: 結果のアンダーフロー .\" .I errno .\" is set to .\" .BR ERANGE . .\"O An underflow floating-point exception .\"O .RB ( FE_UNDERFLOW ) .\"O is raised. アンダーフロー浮動小数点例外 .RB ( FE_UNDERFLOW ) が上がる。 .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=6801 .\"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 remainder (3), .BR remquo (3)