C++ 取整函数
- ceil 上取整 : 库函数 double ceil(double x) 返回大于或等于 x 的最小的整数值
- floor 下取整:double floor(double x) 返回小于或等于 x 的最大的整数值。
error: 'ceil' is not a member of 'std'
或者
error: 'floor' is not a member of 'std'
#include <math.h>
上面的有时候不好用
#include <cmath>
不好用的原因如下:
