C ++ llabs()函数 (C++ llabs() function)

llabs() function is a library function of cstdlib header. It used to get the absolute of the given value. This function is similar to the abs() and labs() functions except for the type of the parameter, it is used for the long long integer values. It accepts a parameter and returns the absolute value.

llabs()函数cstdlib标头的库函数。 它用来获取给定值的绝对值。 除了参数的类型外,此函数与abs()和labs()函数类似,它用于long long整数值。 它接受一个参数并返回绝对值。

Syntax of llabs() function:

llabs()函数的语法:

C++11:

C ++ 11:

    long long int llabs (long long int n);

Parameter(s):

参数:

  • n – represents the value whose absolute value to found.

    n –表示要找到其绝对值的值。

Return value:

返回值:

The return type of this function is long long int, it returns the absolute value.

该函数的返回类型为long long int ,它返回绝对值。

Example:

例:

    Input:
n = -1234567890987654321
Function call:
llabs(n);
Output:
1234567890987654321
Input:
n = 1234567890987654321
Function call:
llabs(n);
Output:
1234567890987654321

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

// C++ code to demonstrate the example of
// llabs() function
#include <iostream>
#include <cstdlib>
using namespace std;
// main() section
int main()
{
long long int n;
n = -1234567890987654321;
cout << "llabs(" << n << "): " << llabs(n) << endl;
n = 1234567890987654321;
cout << "llabs(" << n << "): " << llabs(n) << endl;
n = -1111222233334444555;
cout << "llabs(" << n << "): " << llabs(n) << endl;
n = 1111222233334444555;
cout << "llabs(" << n << "): " << llabs(n) << endl;
return 0;
}

Output

输出量

llabs(-1234567890987654321): 1234567890987654321
llabs(1234567890987654321): 1234567890987654321
llabs(-1111222233334444555): 1111222233334444555
llabs(1111222233334444555): 1111222233334444555

Reference: C++ llabs() function

参考: C ++ llabs()函数

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

C ++中带有示例的llabs()函数相关推荐

  1. python sep函数_Python中带有print()函数的sep参数

    python sep函数 sep parameter stands for separator, it uses with the print() function to specify the se ...

  2. c++ cdi+示例_C ++中带有示例的本地类

    c++ cdi+示例 C ++中的本地类 (Local Class in C++) In C++, generally a class is declared outside of the main( ...

  3. c语言 函数的参数传递示例_C语言中带有示例的remove()函数

    c语言 函数的参数传递示例 C语言中的remove()函数 (remove() function in C) The remove() function is defined in the <s ...

  4. asinh函数_JavaScript中带有示例的Math.asinh()方法

    asinh函数 JavaScript | Math.asinh()方法 (JavaScript | Math.asinh() Method) Math.asinh() is a function in ...

  5. c语言getchar函数_C语言中带有示例的getchar()函数

    c语言getchar函数 C语言中的getchar()函数 (getchar() function in C) The getchar() function is defined in the < ...

  6. repeating 路由_CSS中带有示例的repeating-linear-gradient()函数

    repeating 路由 Introduction: 介绍: So far, we have learned so many functions but learning never gets eno ...

  7. c语言atoll函数怎么用_C ++中带有示例的atoll()函数

    c语言atoll函数怎么用 C ++ Atoll()函数 (C++ atoll() function) atoll() function is a library function of cstdli ...

  8. c语言 div ldiv_C ++中带有示例的ldiv()函数

    c语言 div ldiv C ++ ldiv()函数 (C++ ldiv() function) ldiv() function is a library function of cstdlib he ...

  9. nanf flash校验_C ++中带有示例的nanf()函数

    nanf flash校验 C ++ Nanf()函数 (C++ nanf() function) nanf() function is a library function of cmath head ...

最新文章

  1. ECLIPSE在线安装SVN
  2. 基于锚框与无需锚框的通用物体检测算法
  3. Scala堆的方式进行Spark topK词频查询(根据value进行TreeMap排序)
  4. nginx-http服务器
  5. 打造轻量化的View Controller
  6. C++关键字:重学记录
  7. python2与python3同时安装_Win10下python3和python2同时安装并解决pip共存问题
  8. php引用类,thinkphp引用类的使用
  9. 项目中通用的顶部标题和返回的TitleBar
  10. mysql的安装与卸载
  11. 网络地址转换 NAT
  12. C语言基础第三次作业
  13. Linux设置免密登录
  14. STC8PROG - Linux下的 STC8G STC8H 烧录工具
  15. Unity世界坐标转换屏幕坐标(概览)
  16. 《Internet-常见域名后缀大全》
  17. 论文阅读:Factorizable Net: An Efficient Subgraph-based Framework for Scene Graph Generation
  18. VScode直接执行ts文件
  19. 真我Realme GT Neo5有无线充电吗? 真我Realme GT Neo5快充速度是多少瓦?
  20. 班级日常工作管理系统

热门文章

  1. c语言的程序结构语序,第3章 C语序结构.doc
  2. 大整数算术求值 c语言 栈,用C语言实现 多位整数的四则运算,用栈,例如56*(12+20)-102/2...
  3. ionic保存到mysql_ionic sqlite 存取数据封装(兼容真机与webkit浏览器)
  4. 树莓派摄像头_Arducam 8MP重磅来袭,为树莓派4B构建完全同步的双摄像头方案~
  5. python几何拼贴画_图形几何图形拼贴画
  6. 井通swtc能不能涨到2元_买一支2块到3块之间的股票,买几十万股吗?这样操作效果怎么样?...
  7. Node.js 根本没有这样搞性能优化的?
  8. KVC/KVO实现原理分析
  9. jquery将表单序列化json对象
  10. php页面底部信息居中,css底部如何局中?css三种居中方法