美文网首页
比特币总量

比特币总量

作者: 疯狂的冰块 | 来源:发表于2018-02-10 17:58 被阅读41次

比特币总量计算公式

#!/usr/bin/env python

"""

desc : calculate the total amount of BitCoin

time : 2018-2-10 00:02:17

author : bsqql123@163.com

"""
sum = 0
# 50个比特币,等于5,000,000,000 聪,聪是比特币的最小单位
size = 50 * 10000000
index = 0
while (size >= 1):
    index += 1
    size = int(size)
    sum += 210000 * size
    print(f"第{index}次减半,每个区块产生的比特币为{size},产生的总量为:{sum}")
    size = size / 2


相关文章

网友评论

      本文标题:比特币总量

      本文链接:https://www.haomeiwen.com/subject/ahhhtftx.html