以下内容来自:
https://www.cnblogs.com/SZxiaochun/p/6961370.html
import math f = 11.2 print math.ceil(f) #向上取整 print math.floor(f) #向下取整 print round(f) #四舍五入 #这三个函数的返回结果都是浮点型
以下内容来自:
https://www.cnblogs.com/SZxiaochun/p/6961370.html
import math f = 11.2 print math.ceil(f) #向上取整 print math.floor(f) #向下取整 print round(f) #四舍五入 #这三个函数的返回结果都是浮点型
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。