rint, lrint, llrint
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <math.h>
|
||
| int rintf( float arg ); |
(C99 起) | |
| int rint( double arg ); |
(C99 起) | |
| int rintl( long double arg ); |
(C99 起) | |
| long lrintf( float arg ); |
(C99 起) | |
| long lrint( double arg ); |
(C99 起) | |
| long lrintl( long double arg ); |
(C99 起) | |
| long long llrintf( float arg ); |
(C99 起) | |
| long long llrint( double arg ); |
(C99 起) | |
| long long llrintl( long double arg ); |
(C99 起) | |
舍入浮点参数
arg一个整数值,浮点格式,使用当前的舍入模式。如果结果是不同的arg(即arg已经不是一个整数值),的浮点异常FE_INEXACT,提高.Original:
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.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 参数
| arg | - | 浮点值
Original: floating point value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[编辑] 返回值
的整数结果四舍五入
argOriginal:
The integer result of rounding
argThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 注释
唯一的区别nearbyint和rint的是,rint可以提高FE_INEXACT浮点异常,而nearbyint不会提高.
Original:
The only difference between nearbyint and rint is that rint may raise the FE_INEXACT floating-point exception, while nearbyint never raises it.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 为例
| 本节是不完整的 原因: no example |
[编辑] 另请参阅
| (C99) |
最接近的整数,使用当前的舍入模式 Original: nearest integer using current rounding mode The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) |
| (C99) |
最接近的整数的幅值比不大于给定值 Original: nearest integer not greater in magnitude than the given value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) |
| C++ documentation for rint
| |