9、 math
实数
floor(x):向下取整,但返回的不是整数,而是浮点数
ceil(x):向上取整,返回值为float
sqrt(x):求根值,返回值为float
>>>import math
>>>math.floor(2.3)
2.0
复数
>>>import cmath
>>>cmath.sqrt(-1)
1j
实数
floor(x):向下取整,但返回的不是整数,而是浮点数
ceil(x):向上取整,返回值为float
sqrt(x):求根值,返回值为float
>>>import math
>>>math.floor(2.3)
2.0
复数
>>>import cmath
>>>cmath.sqrt(-1)
1j