如何在编译时计算非整数的舍入值,即float/double值?以通常的最佳方式,作为函数形式,例如constexpr fn(double n){}
constexpr fn(double n){}
cMath库中有一些函数。 例如:
cMath
round() ceil() floor() trunc() lround()
这里有完整的列表