How to make counter that start from: 10000000000000000000000000000000000000000000000000000000000000000000000000000
and stop when it gets to: 10000000000000000000000000000000000000000000000000000000000000009999999999999
I have this code:
count,one := new(big.Int), big.NewInt(1)
count.SetString("10000000000000000000000000000000000000000000000000000000000000000000000000000",10)
I know this is easy for someone but Im newbi at GoLang so don't be angry if my question is stupid for you :)
Thanks anyway
There you go
package main
import (
"fmt"
"math/big"
)
func main() {
n1 := new(big.Int)
n1.SetString("100000000000000000000000000000000000000000000000000000000", 10)
n2 := new(big.Int)
n2.SetString("100000000000000000000000000000000000000000000000000000009", 10)
one := big.NewInt(1)
for i := n1; i.Cmp(n2) < 0; i.Add(i, one) {
//fmt.Println(i)
}
}
Just fit the right numbers into SetString
.