会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
小小程序员ol
博客园
首页
新随笔
联系
订阅
管理
2024年7月16日
Python教程:ceil、floor、round、int取整
摘要: 1.向上取整 math.ceil math.ceil() 严格遵循向上取整,所有小数都向着数值更大的方向取整。 import math math.ceil(-1.5) # -1 math.ceil(1.5) # 2 math.ceil(-0.9) # 0 2.向下取整 math.floor 同 ma
阅读全文
posted @ 2024-07-16 15:32 小小程序员ol
阅读(16)
评论(0)
推荐(0)
编辑
公告