- 博客(1)
- 收藏
- 关注
原创 python的浮点数取整与取小数
import mathx, y = math.modf(1.125)print(x)print(y)print(type(x))'''输出0.1251.0<class 'float'>'''# 向上取整ceil()# 向下取整floor()# 向零取整int()math.trunc()# 四舍五入取整round()
2021-11-10 15:25:39 1751 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人