当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
RNA核糖核酸修饰RNA-HiLyte FluorTM 405荧光染料|RNA-HiLyte FluorTM 405
【leetcode】剑指 Offer II 008. 和大于等于 target 的最短子数组(滑动窗口,双指针)
宁德时代2号人物黄世霖辞任副董事长:身价1370亿
力扣59-螺旋矩阵 II——边界判断
JWT详解
消除对特权账户的依赖使用Kaniko构建镜像
matplotlib画polygon, circle
Auto.js脚本程序打包
李沐动手学深度学习V2-自然语言推断与数据集SNLI和代码实现
leetcode 072. 求平方根
The sword refers to Offer II 044. The maximum value of each level of the binary tree-dfs method
子树的大小
Anaconda virtual environment migration
Golang死信队列的使用
极验深知v2分析
2022 CCF中国开源大会会议通知(第三轮)
不知道这4种缓存模式,敢说懂缓存吗?
基础软件与开发语言开源论坛| ChinaOSC
「学习笔记」高斯消元
友宏医疗与Actxa签署Pre-M Diabetes TM 战略合作协议