java 对浮点数取整方法floor,…

在java中的Math类中有三种方法对浮点数取整 floor //向下取整 ceil //向上取整 round //四舍五入取整 例如: Math.floor(1.3); // 1 Math.floor(1.7); //1 Math.ceil(1.3); //2 Math.ceil(1.7); //2 Math.round(1.3); //1 Math.round(1.7); //2 很简单的办法
相关文章
相关标签/搜索