floor(x) 向下取整
floor(2.5)=2
floor(-2.5)=-3
ceil(x) 向上取整
ceil(2.5)=3
ceil(-2.5)=-2
round(x) 取最接近的整数,如果小数部分为0.5,则向绝对值大的方向取整
round(2.5)=3
round(-2.5)=-3
fix(x) 向0取整
fix(2.5)=2
fix(-2.5)=-2
floor(x) 向下取整
ceil(x) 向上取整
ceil(-2.5)=-2
round(x) 取最接近的整数,如果小数部分为0.5,则向绝对值大的方向取整
round(-2.5)=-3
fix(x) 向0取整