math模块一些用法
- trunc(x) 传入整数或浮点数, 返回 数值的整数部分, 忽略小数部分,不会四舍五入
import math
math.trunc(2.77) # 2
math.trunc(8.32) # 8
math.trunc(-99.99) # -99
标签:Python,整数,用法,模块,math,trunc
From: https://www.cnblogs.com/jessecheng/p/16665367.html
import math
math.trunc(2.77) # 2
math.trunc(8.32) # 8
math.trunc(-99.99) # -99
标签:Python,整数,用法,模块,math,trunc
From: https://www.cnblogs.com/jessecheng/p/16665367.html