avx2 fma

C ++ fma()函数 (C++ fma() function)

fma() function is a library function of cmath header, it is used to find the result of multiply-add, it accepts three arguments and returns the result of the expression where first and second arguments will be multiplied and the third argument will be added to the multiplied result. It the arguments are x, y and z, it returns (x*y+z).

fma()函数cmath标头的库函数,用于查找乘加结果,它接受三个参数并返回表达式的结果,其中第一个和第二个参数将相乘,第三个参数将被添加相乘的结果。 如果参数是x , y和z ,则返回(x * y + z) 。

Note: The fma() function computes and returns the exact result without losing precision.

注意: fma()函数计算并返回精确结果,而不会损失精度。

Syntax of fma() function:

fma()函数的语法:

    fma(x, y, z);

Parameter(s): x, y, z – are the numbers to calculate the multiply-add.

参数: x,y,z –是用于计算乘加的数字。

Return value: double – it returns double value that is the result of x*y+z.

返回值: double-返回x * y + z的结果double值。

Example:

例:

    Input:
float x = 10.20;
float y = 20.91;
float z = 30.12;
Function call:
fma(x, y, z);
Output:
243.402

C ++代码演示fma()函数的示例 (C++ code to demonstrate the example of fma() function)

// C++ code to demonstrate the example of
// fma() function
#include <iostream>
#include <cmath>
using namespace std;
// main() section
int main()
{float x,y,z;
float result;
x = 1;
y = 2;
z = 3;
result = fma(x,y,z);
cout<<"result: "<<result<<endl;
x = 10.20;
y = 20.91;
z = 30.12;
result = fma(x,y,z);
cout<<"result: "<<result<<endl;
x = -10.21220;
y = 20.9122;
z = -30.1212;
result = fma(x,y,z);
cout<<"result: "<<result<<endl;
return 0;
}

Output

输出量

result: 5
result: 243.402
result: -243.681

翻译自: https://www.includehelp.com/cpp-tutorial/fma-function-with-example.aspx

avx2 fma

avx2 fma_fma()函数以及C ++中的示例相关推荐

  1. python 功能键ord_ord()函数以及Python中的示例

    Python ord() 功能 ord()函数是Python中的一个库函数,它用于从给定的字符值中获取数字值,它接受一个字符并返回一个整数,即用于将字符转换为整数,即用于获取a的ASCII值.给定的字 ...

  2. python中pow函数_pow()函数以及Python中的示例

    python中pow函数 Python pow()函数 (Python pow() function) pow() function is a library function in Python, ...

  3. to_number用法示例_Number()函数以及JavaScript中的示例

    to_number用法示例 Number()函数 (Number() function) Number() function is a predefined global function in Ja ...

  4. eval 函数 代替函数_eval()函数以及JavaScript中的示例

    eval 函数 代替函数 eval()函数 (eval() function) eval() function is a predefined global function in JavaScrip ...

  5. python中len函数_len()函数以及Python中的示例

    python中len函数 Python len()函数 (Python len() function) len() function is a library function in Python, ...

  6. java中isnan函数_isNaN()函数以及JavaScript中的示例

    java中isnan函数 Prerequisite: NaN property in JavaScript 先决条件: JavaScript中的NaN属性 isNaN()函数 (isNaN() fun ...

  7. c语言 函数的参数传递示例_isgreater()函数以及C ++中的示例

    c语言 函数的参数传递示例 C ++ isgreater()函数 (C++ isgreater() function) isgreater() function is a library functi ...

  8. fmax()函数以及C ++中的示例

    C ++ fmax()函数 (C++ fmax() function) fmax() function is a library function of cmath header, it is use ...

  9. isless()函数与C ++中的示例

    C ++ isless()函数 (C++ isless() function) isless() function is a library function of cmath header, it ...

最新文章

  1. Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) B. Verse Pattern 水题
  2. html5 php服务器搭建,使用Apache 搭建web 网站服务器
  3. [LeetCode]ZigZag Conversion
  4. this ts 方法获取_vue+typescript项目中用this.$refs和原生方法获取的dom有什么区别
  5. 取得Access自增标识字段在插入数据后的id值
  6. mac怎么用终端编写c语言视频,【新手提问】有知道用mac终端编c语言的网络编程的人吗?...
  7. 桌面软件打开都会变成计算机,我不小心把电脑界面程序的打开方式都变成一种了,怎么还原啊?...
  8. linux curl 编译命令,linux 编译 curl 出错
  9. 中职计算机高考总分是多少,高考理科总分是多少分
  10. android paint 线宽_Paint setStrokeWidth方法:设置空心线宽
  11. 支付接口调用成功后如何让前端知道_开发口中的「接口」到底是什么
  12. mac读写ntfs工具
  13. jQuery(九):节点遍历
  14. 使用Spring Boot CLI的Spring Boot Initilizr
  15. 工作完成了,切勿激动,一定要先求证
  16. 华硕网吧服务器型号,华硕服务器-Z10PA-D8 | 专业网吧维护
  17. refprop物性库_REFPROP下载-REFPROP官方版下载[制冷剂物性查询]-天极下载
  18. st7789 旋转_st7789v spi通信
  19. 【IoT】产品外包策略:外包地图-充分利用内外部资源
  20. 【薛定谔方程求解】基于MATLAB的薛定谔方程求解仿真

热门文章

  1. Vue中父子之间的通信
  2. 3亿美元换0.003秒,但时间一直这么贵!
  3. 读《指数基金定投指南》感想
  4. java B2B2C springmvc mybatis电子商务平台源码-服务的注册与发现(Eureka)
  5. soso地图低调推出!
  6. SOSO地图JavaScript画出标注和中心点
  7. GreenPlum的学习心得和知识总结(三)|Greenplum数据库快速入门
  8. UE4构建光照后,BSP创建的静态网格变全黑
  9. html 按钮立体效果,纯CSS实现的立体按钮
  10. 【安卓学习积累】IntentService的源码分析