会员
众包
新闻
博问
闪存
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
shui00cc
博客园
首页
新随笔
联系
订阅
管理
2023年6月8日
Python取整及四舍五入
摘要: 向上取整:math.ceil() import math math.ceil(-0.9) >>> 0 math.ceil(0.3) >>> 1 向下取整:math.floor()、int()、//(整除) math.floor(-0.3) >>> -1 int(0.9) >>> 0 3 // 2 #
阅读全文
posted @ 2023-06-08 22:01 shui00cc
阅读(421)
评论(1)
推荐(0)
编辑