Re: [go-nuts] Re: When appending to arrays, gmp.Int values change for large number arrays

2017-05-14 Thread dantesepicsneeze
Thank you so much, that solved our problem! :D On Sunday, May 14, 2017 at 4:06:12 PM UTC-4, Kale B wrote: > > There's a finalizer being set on `*gmp.Int` when `SetString()` is called. > Since `newnum` is a `gmp.Int` and not a `*gmp.Int` and `newnum` is copied > into `output_array`, the pointer

[go-nuts] Re: When appending to arrays, gmp.Int values change for large number arrays

2017-05-14 Thread dantesepicsneeze
Here is a test case below. In short, it's appending the same number to an array, but after 2500 loops or so the value changes. package main import ( "fmt" "github.com/ncw/gmp" // "math/big" ) func test_gmp_array() { index := 0 output_array := []gmp.Int{} for index < 5000

[go-nuts] When appending to arrays, gmp.Int values change for large number arrays

2017-05-13 Thread dantesepicsneeze
We're using gmp (library found at https://github.com/ncw/gmp) to run on large inputs, and we have arrays with thousands of elements at a time in our code. When we write these arrays to files, we find that the values of some of the elements have changed. We tested our by code by reading in an