rint, lrint, llrint
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <math.h> 中定义
|
||
| int rintf( float arg ); |
||
| int rint( double arg ); |
||
| int rintl( long double arg ); |
||
| long lrintf( float arg ); |
||
| long lrint( double arg ); |
||
| long lrintl( long double arg ); |
||
| long long llrintf( float arg ); |
||
| long long llrint( double arg ); |
||
| long long llrintl( long double arg ); |
||
舍入浮点参数
arg一个整数值,浮点格式,使用当前的舍入模式。如果结果是不同的arg(即arg已经不是一个整数值),的浮点异常FE_INEXACT,提高.原文:
Rounds the floating-point argument
arg to an integer value in floating-point format, using the current rounding mode. If the result differs from arg (i.e., arg was not an integer value already), the floating-point exception FE_INEXACT is raised.目录 |
[编辑] 参数
| arg | - | 浮点值
|
[编辑] 返回值
的整数结果四舍五入
arg[编辑] 注释
唯一的区别nearbyint和rint的是,rint可以提高FE_INEXACT浮点异常,而nearbyint不会提高.
[编辑] 示例
| 本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
| (C99) |
最接近的整数,使用当前的舍入模式 原文: nearest integer using current rounding mode (函数) |
| (C99) |
最接近的整数的幅值比不大于给定值 原文: nearest integer not greater in magnitude than the given value (函数) |
| C++ documentation for rint
| |