蓝螃蟹Karry0921

导航

用python计算圆周率PI

PI = 0
N = 100
for k in range(N):
PI += 1 / pow(16,k) * (4 / (8 * k + 1) - 2 / (8 * k + 4) -1 / (8 * k + 5) - 1 / (8 * k + 6))
print("圆周率值是:{}".format(pi))

 

 姓名:蓝螃蟹Karry0921

学号:3039

posted on 2021-10-16 21:15  蓝螃蟹Karry0921  阅读(100)  评论(0编辑  收藏  举报