C++官网参考链接:https://cplusplus.com/reference/cmath/rint/
函数
<cmath> <ctgmath>
rint
C99
double rint(double x);
float rintf(float x);
long double rintl(long double x);
C++11
double rint(double x);
float rint(float x);
long double rint(long double x);
double rint (T x); // additional overloads for integral types
舍入到整型值
使用fegetround指定的舍入方向将x舍入为整型值。
如果返回的值与x的值不同,此函数可能会引发FE_INEXACT异常。有关不能引发此类异常的等价函数,请参见nearbyi