JAVA Math.round(),Math.floor(),Math.ceil()

1.round(),"四舍五入"(跟普通的四舍五入有区别)(temp = temp+0.5,返回不大于temp的最大整数(向下取整)),能够理解为Math.floor(temp+0.5);spa

2.floor(),返回不大于它的最大整数(向下取整(最大的))blog

3.ceil(),返回不小于它的最小整数(向上取整(最小的))im

答案在后面。img

 

 

 

 

 

 

 

 

相关文章
相关标签/搜索