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

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


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



四舍五入:
round(4.5)=4
round(4.6)=5

猜你喜欢

转载自www.cnblogs.com/LoganChen/p/11992005.html
今日推荐