std::fma
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <cmath> 中定义
|
||
float fma( float x, float y, float z ); |
(1) | (C++11 起) |
double fma( double x, double y, double z ); |
(2) | (C++11 起) |
long double fma( long double x, long double y, long double z ); |
(3) | (C++11 起) |
Promoted fma( Arithmetic x, Arithmetic y, Arithmetic z ); |
(4) | (C++11 起) |
#define FP_FAST_FMA /* implementation-defined */ |
(5) | (C++11 起) |
#define FP_FAST_FMAF /* implementation-defined */ |
(6) | (C++11 起) |
#define FP_FAST_FMAL /* implementation-defined */ |
(7) | (C++11 起) |
的FMA功能计算(x*y) + z,四舍五入为一个三元操作,根据
原文:
The fma functions compute (x*y) + z, rounded as one ternary operation, according to the
舍入模式,其特征在于由值FLT_ROUNDS.
4) 原文:
rounding mode characterized by the value of FLT_ROUNDS.
如果任何参数是整数类型,它被转换为double。如果有另一种说法是long double,则返回类型是long double,否则它是double.
5-7) 原文:
If any argument has integral type, it is cast to double. If any other argument is long double, then the return type is long double, otherwise it is double.
如果宏常量
FP_FAST_FMAF
,FP_FAST_FMA
,或FP_FAST_FMAL
的定义,功能std::fma
计算速度比x*y+z,float,double参数,分别表达long double。如果定义,这些宏的评估整数1原文:
If the macro constants
FP_FAST_FMAF
, FP_FAST_FMA
, or FP_FAST_FMAL
are defined, the function std::fma
evaluates faster than the expression x*y+z for float, double, and long double arguments, respectively. If defined, these macros evaluate to integer 1.[编辑] 参数
x, y, z | - | 浮点值
|
[编辑] 返回值
(x*y) + z,四舍五入为一个三元操作
原文:
(x*y) + z, rounded as one ternary operation
[编辑] 另请参阅
(C++11) |
签署剩余的除法运算 原文: signed remainder of the division operation (函数) |
(C++11) |
签署其余部分以及最后三个位的除法运算 原文: signed remainder as well as the three last bits of the division operation (函数) |