Python中取整的方法floor,ceil,round

地板函数:
math.floor(4.9)=4


天花板函数:
math.ceil(4.1)=5



四舍五入:
round(4.5)=4
round(4.6)=5
posted @ 2019-12-05 21:22  alittlecomputer  阅读(689)  评论(0编辑  收藏  举报