向上取整为存在大于0的小数位该数+1; 向下取整为存在大于0的小数位该数-1; 四舍五入为小数大于5的+1.
#include <math.h>
ceil(0.1); // 输出:1
ceil(-0.1); // 输出:0
#include <QtMath>
qCeil(0.1); // 输出:1
qCeil(-0.1); // 输出:0
#include <math.h>
floor(0.1); // 输出:0
floor(-0.1); // 输出:-1
#include <QtMath>
qFloor(0.1); // 输出:0
qFloor(-0.1); // 输出:-1
#include <math.h>
round(0.5); // 输出:0