当前位置:网站首页>Abs (), fabs () and LABS ()
Abs (), fabs () and LABS ()
2022-08-03 20:12:00 【Luna programming】
abs ()
Syntax:
#include
int abs( int num ); //parameter type is int typep>
Function: The function returns the absolute value of the parameter num.For example:
int magic_number = 10;cout << "Enter a guess: ";cin >> x;cout << "Your guess was " << abs( magic_number - x ) << " away from the magic number." << endl;labs ()
Syntax:
#include
long labs( long num );//The parameter type is long long
Function: The function returns the absolute value of the parameter num.
fabs ()
Syntax:
#include
double fabs( double arg );//The parameter type is double
Function: The function returns the absolute value of the parameter arg.
Mainly to find the absolute value of the higher precision double or float type
The above three functions can share a header file

边栏推荐
猜你喜欢
随机推荐
那些年我写过的语言
C中的数据存储
极验深知v2分析
若依集成easyexcel实现excel表格增强
EasyCVR平台海康摄像头语音对讲功能配置的3个注意事项
阿洛的反思
Detailed demonstration pytorch framework implementations old photo repair (GPU)
基础软件与开发语言开源论坛| ChinaOSC
【飞控开发高级教程3】疯壳·开源编队无人机-定高、定点、悬停
leetcode 1837. K 进制表示下的各位数字总和
leetcode 268. 丢失的数字(异或!!)
622 设计循环队列——Leetcode天天刷【循环队列,数组模拟,双指针】(2022.8.2)
友宏医疗与Actxa签署Pre-M Diabetes TM 战略合作协议
高性能计算软件与开源生态| ChinaOSC
多模态 参考资料汇总
2022 CCF中国开源大会会议通知(第三轮)
RNA核糖核酸修饰RNA-HiLyte FluorTM 405荧光染料|RNA-HiLyte FluorTM 405
盲埋孔PCB叠孔设计的利与弊
嵌入式分享合集27
演讲议题及嘉宾重磅揭晓,TDengine 开发者大会推动数据技术“破局”








[email protected] 610/