.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) .\" Distributed under GPL .\" %%%LICENSE_END .\" .\" Modified 2004-11-15, Added further text on FLT_ROUNDS .\" as suggested by AEB and Fabian Kreutz .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" 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 2013\-09\-17 "" "Linux Programmer's Manual" .SH 名前 fma, fmaf, fmal \- 浮動小数点数の積と和を計算する .SH 書式 .nf \fB#include \fP .sp \fBdouble fma(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB, double \fP\fIz\fP\fB);\fP .br \fBfloat fmaf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB, float \fP\fIz\fP\fB);\fP .br \fBlong double fmal(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB, long double \fP\fIz\fP\fB);\fP .fi .sp \fI\-lm\fP でリンクする。 .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l \fBfma\fP(), \fBfmaf\fP(), \fBfmal\fP(): .RS 4 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or \fIcc\ \-std=c99\fP .RE .ad .SH 説明 \fBfma\fP() 関数は \fIx\fP * \fIy\fP + \fIz\fP を計算する。 結果は、一つの三項演算として現在の丸めモードにしたがって丸められる (\fBfenv\fP(3) 参照)。 .SH 返り値 これらの関数は \fIx\fP * \fIy\fP + \fIz\fP の、一つの三項演算として丸められた値を返す。 \fIx\fP か \fIy\fP が NaN の場合、NaN が返される。 \fIy\fP の \fIx\fP 倍がちょうど無限大で、 \fIz\fP がそれとは反対の符号の無限大の場合、 領域エラー (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. .\" POSIX.1 says that a NaN or an implementation-defined value shall .\" be returned for this case. \fIx\fP と \fIy\fP のうち一方が無限大で、もう一方が 0 で、 \fIz\fP が NaN でない場合、領域エラーが発生し、NaN が返される。 .\" POSIX.1 makes the domain error optional for this case. \fIx\fP と \fIy\fP のうち一方が無限大で、もう一方が 0 で、 \fIz\fP が NaN の場合、領域エラーが発生し、NaN が返される。 \fIy\fP の \fIx\fP 倍が 0 の無限大倍 (もしくはその逆) ではなく、 \fIz\fP が NaN の場合、NaN が返される。 結果がオーバーフローする場合、範囲エラー (range error) が発生し、 正しい符号の無限大が返される。 結果がアンダーフローする場合、 範囲エラーが発生し、符号付きの 0 が返される。 .SH エラー これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7) を参照のこと。 .PP 以下のエラーが発生する可能性がある。 .TP 領域エラー: \fIx\fP * \fIy\fP + \fIz\fP か \fIx\fP * \fIy\fP が無効で、\fIz\fP が NaN ではない .\" .I errno .\" is set to .\" .BR EDOM . 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP) が上がる。 .TP 範囲エラー (range error): 結果のオーバーフロー .\" .I errno .\" is set to .\" .BR ERANGE . オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP) が上がる。 .TP 範囲エラー (range error): 結果のアンダーフロー .\" .I errno .\" is set to .\" .BR ERANGE . アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP) が上がる。 .PP .\" FIXME . Is it intentional that these functions do not set errno? .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6801 これらの関数は \fIerrno\fP を設定しない。 .SH バージョン これらの関数は glibc バージョン 2.1 で初めて登場した。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" 関数 \fBfma\fP(), \fBfmaf\fP(), \fBfmal\fP() はスレッドセーフである。 .SH 準拠 C99, POSIX.1\-2001. .SH 関連項目 \fBremainder\fP(3), \fBremquo\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。