Python 系列文章 —— math 详解

2022-01-13 10:48:55 浏览数 (1)

  • math_demo
代码语言:python代码运行次数:0复制
import math

print(dir(math))

print(math.ceil(-1))
print(math.ceil(1.024))

print(math.copysign(1,-1))

print(math.fabs(-1))

print(math.factorial(6))
print(math.factorial(-6))

print(math.floor(-1.024))
print(math.floor(1024))

print(math.fmod(1,2))

print(math.frexp(1024))

print(math.fsum([1,2,3,4,5,6]))

print(math.gcd(3, 9))

print(math.exp(6))

print(math.expm1(6))

print(math.log(10,24))

print(math.log1p(1024))

print(math.log2(1024))

print(math.pow(6,2))

print(math.sqrt(1024))

print(math.acos(0.5))
print(math.acos(3))

print(math.asin(0.5))

print(math.atan(0.5))

print(math.cos(0.5))

print(math.sin(0.5))

print(math.sin(0.5))

int(math.pi)

0 人点赞