摘要: 一、背景 日常工作中,如果对数据精度不敏感,则可以使用 ceil、floor、round 等函数对数据做取整、四舍五入操作即可。 # 取整 import math x = 11.245 math.ceil(x) # 向上 12 math.floor(x) # 向下 11 round(x) # 四舍五 阅读全文
posted @ 2022-01-14 09:56 Hider1214 阅读(1393) 评论(0) 推荐(0)