package main
import (
"math"
"fmt"
)
func DecayPeriod() int {
return int(math.Round(10*210000.0/60/24/365))
}
func DecayTimes() (float64,int) {
btc:=50.0
reward:=0.0
times:=0
for btc>=math.Pow10(-8) {
reward+=210000*btc
btc*=.5
times++
}
return reward,times
}
func main() {
period:=DecayPeriod()
reward,times:=DecayTimes()
start:=2008
end:=start+period*times
fmt.Print(reward,end)
}
Bitcoins will be stopped issuing in 2140 and 21 million bitcoins in total
猜你喜欢
转载自blog.csdn.net/baidu_25845567/article/details/84306537
今日推荐
周排行