bigint - Big int ranges in Go -


is there way loop on intervals between 2 big int values, x , y, in go?

for i: = x; < y; i++ {     // } 

working big numbers can kind of clunky because need create big.int constants. other that, straight forward replacement of each segment of statement 1 made deal big ints.

http://play.golang.org/p/plsd8yf9lz

package main  import (     "fmt"     "math/big" )  var 1 = big.newint(1)  func main() {     start := big.newint(1)     end := big.newint(5)     // must new int not overwrite start     := new(big.int).set(start); i.cmp(end) < 0; i.add(i, one) {         fmt.println(i)     } } 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -