美文网首页
round ceil floor

round ceil floor

作者: hehehehe | 来源:发表于2020-08-21 00:13 被阅读0次

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