我需要一个简单的浮点舍入函数,因此:
double round(double); round(0.1) = 0 round(-0.1) = 0 round(-0.9) = -1
我能找到ceil()和floor()在math.h中-但不是round().
ceil()
floor()
round()
它是以另一个名称存在于标准C++库中,还是缺少?
c++ floating-point rounding
c++ ×1
floating-point ×1
rounding ×1