当前位置:网站首页>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

边栏推荐
猜你喜欢

149. The largest number on a straight line, and check the set

Internet Download Manager简介及下载安装包,IDM序列号注册问题解决方法

简易电子琴设计(c语言)
![【微信小程序2】事件传参与数据同步[03]](/img/d9/73004e6edf800c583231a94dfbd878.png)
【微信小程序2】事件传参与数据同步[03]

演讲议题及嘉宾重磅揭晓,TDengine 开发者大会推动数据技术“破局”

危化企业双重预防机制数字化建设进入全面实施阶段

算法--交错字符串(Kotlin)

为什么 BI 软件都搞不定关联分析

tRNA-m5C转运RNA(tRNA)修饰5-甲基胞嘧啶(m5C)|tRNA修饰m1Am2A (2-methyladenosine)

数据驱动的软件智能化开发| ChinaOSC
随机推荐
「学习笔记」高斯消元
百利药业IPO过会:扣非后年亏1.5亿 奥博资本是股东
NNLM、RNNLM等语言模型 实现 下一单词预测(next-word prediction)
leetcode 326. 3 的幂
ThreadLocal详解
子结点的数量(2)
php根据两点经纬度计算距离
高性能计算软件与开源生态| ChinaOSC
leetcode 136. 只出现一次的数字(异或!!)
高位套牢机构,用友网络的信任危机是如何产生的?
【飞控开发高级教程4】疯壳·开源编队无人机-360 度翻滚
钱江摩托某型号产品ECU货不对版 消费者知情权应如何保障?
Anaconda virtual environment migration
wordpress建立数据库连接时出错
622 设计循环队列——Leetcode天天刷【循环队列,数组模拟,双指针】(2022.8.2)
危化企业双重预防机制数字化建设进入全面实施阶段
Go语言类型与接口的关系
力扣707-设计链表——链表
C中的数据存储
2022 年值得尝试的 7 个 MQTT 客户端工具