博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c语言 函数的参数传递示例_llround()函数以及C ++中的示例
阅读量:2530 次
发布时间:2019-05-11

本文共 1361 字,大约阅读时间需要 4 分钟。

c语言 函数的参数传递示例

C ++ llround()函数 (C++ llround() function)

llround() function is a library function of cmath header, it is used to round the given value and casts to a long long integer, it accepts a number and returns the integer (long long int) value that is nearest to the number (with halfway cases).

llround()函数cmath标头的库函数,用于舍入给定值并将其转换为长整型整数,它接受一个数字并返回最接近该数字的整数(长整型int)值(带有中途案例)。

Syntax of llround() function:

llround()函数的语法:

llround(x);

Parameter(s): x – is the number to round nearest to zero with halfway cases.

参数: x –是中途取整的数字,最接近零。

Return value: long long int – it returns long long int type value that is the rounded value of the number x.

返回值: long long int –返回long long int类型值,该值是数字x的舍入值。

Example:

例:

Input:    float x = 2.3;        Function call:    llround(x);        Output:    2    Input:    float x = 2.8;    Function call:    llround(x);        Output:    3

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

// C++ code to demonstrate the example of // llround() function#include 
#include
using namespace std;// main() sectionint main(){
float x; x = 15.3; cout<<"llround("<
<<"): "<
<

Output

输出量

llround(15.3): 15llround(15.5): 16llround(15.8): 16llround(-15.3): -15llround(-15.5): -16llround(-15.8): -16

翻译自:

c语言 函数的参数传递示例

转载地址:http://wyxzd.baihongyu.com/

你可能感兴趣的文章
SQLServer 分组查询相邻两条记录的时间差
查看>>
Swift语言指南(一)--语言基础之常量和变量
查看>>
关于webpack的使用
查看>>
Windows 2008 R2上配置IIS7或IIS7.5中的URLRewrite(URL重写)实例
查看>>
浅析java垃圾回收机制
查看>>
彻底理解线性筛选法
查看>>
Java Socket总结
查看>>
法语学习笔记
查看>>
使用css的类名交集复合选择器 《转》
查看>>
[USACO18DEC]The Cow Gathering
查看>>
情感分析-英文电影评论
查看>>
王者荣耀游戏服务器架构的演进读后感
查看>>
关于ajax请求controller返回中文乱码的解决方法!
查看>>
Objective-C 和 Core Foundation 对象相互转换的内存管理总结
查看>>
IOS音频1:之采用四种方式播放音频文件(一)AudioToolbox AVFoundation OpenAL AUDIO QUEUE...
查看>>
Linux nmon 命令
查看>>
使用 urllib 构造请求对象
查看>>
sql server book
查看>>
长亭技术专栏 安全攻防技术分享
查看>>
sql server dba
查看>>