>> (p.1)
    Author Topic: Calculate total coins at height  (Read 1134 times)
    tcatm (OP)
    Sr. Member
    ****
    Offline Offline

    Activity: 337
    Merit: 285


    View Profile
    April 05, 2011, 07:41:50 PM
    Last edit: April 05, 2011, 11:30:25 PM by tcatm
     #1

    Hey,

    here's some code that calculates the total number of bitcoins generated at a certain height:

    Code:
    def t(h):
        return (sum([21e4*int(50e8/2**k) for k in xrange(int((h+1)/21e4))])+int(50e8/2**(int((h+1)/21e4)))*((h+1)-(int((h+1)/21e4))*21e4))/1e8
Page 1
Viewing Page: 1