Math.round():返回值是 int/long 类型的,理解为Math.floor(x+0.5):在原来的数上+0.5再向下取整)
Math.floor():返回值是double类型的,向下取整
Math.ceil():返回值是double类型的,向上取整
Math.round():返回值是 int/long 类型的,理解为Math.floor(x+0.5):在原来的数上+0.5再向下取整)
Math.floor():返回值是double类型的,向下取整
Math.ceil():返回值是double类型的,向上取整
本文标题:round ceil floor
本文链接:https://www.haomeiwen.com/subject/aylsjktx.html
网友评论