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 input file of large numbers, casting 
them to gmp.Int, storing them in an array, and writing them to an output 
file. This works for an array of ~1400 numbers, but if the array gets any 
larger than that the values in the array change.

Below we print the first element of our array each time a new element gets 
appended. As the size goes past 1435, the value of the first value changes, 
and it changes again when the size goes past 1437:


output: 1434 
27928410756179523138881080989986005991789933932188228018115755918494634799929873910027825747854697455979387110847058629350347288500624884424807086906801594642406392448568530327829083514883524712985492538589993807582131300292739787897589360129490451849769622648595726892334513355855504557741514903175075958458960111055024641406976670602678887952234068019841236549447926340755063903373950684252611325596552928912480285833159841819645546289989159869982214159616531691638376958340264087137749469269647555189450117026947774590910035240238694361652478067361121651905941283054193444516391789652433009672685099320489013369511

output: 1435 
27928410756179523138881080989986005991789933932188228018115755918494634799929873910027825747854697455979387110847058629350347288500624884424807086906801594642406392448568530327829083514883524712985492538589993807582131300292739787897589360129490451849769622648595726892334513355855504557741514903175075958458960111055024641406976670602678887952234068019841236549447926340755063903373950684252611325596552928912480285833159841819645546289989159869982214159616531691638376958340264087137749469269647555189450117026947774590910035240238694361652478067361121651905941283054193444516391789652433009672685099320489013369511

output: 1436 
27928410756179523138881080989986005991789933932188228018115755918494634799929873910027825747854697455979387110847058629350347288500624884424807086906801594642406392448568530327829083514883524712985492538589993807582131300292739787897589360129490451849769622648595726892334513355855504557741514903175075958458960111055024641406976670602678887952234068019841236549447926340755063903373950684252611325596552928912480285833159841819645546289989159869982214159616531691638376958340264087137749469269647555189450117026947774590910035240238694361652478067361121651905941283054193424735876961338910144554408906597071520268288

output: 1437 
27928410756179523138881080989986005991789933932188228018115755918494634799929873910027825747854697455979387110847058629350347288500624884424807086906801594642406392448568530327829083514883524712985492538589993807582131300292739787897589360129490451849769622648595726892334513355855504557741514903175075958458960111055024641406976670602678887952234068019841236549447926340755063903373950684252611325596552928912480285833159841819645546289989159869982214159616531691638376958340264087137749469269647555189450117026947774590910035240238694361652478067361121651905941283054193424735876961338910144554408906597071520268288

output: 1438 
23937065258617293607419221241376749238853786485747685256178538183999977338295726770968837510115411713639449942813542410122781003049158815334638386757489378865115690993509412251696127283961449052609910367016753503276717219374706887218515185370729246298124537836902676996868643830290196728475836135942660102147078687203464316120920925288760650180847521449886391007761057733951927560142110014087955337930094606086003264404490081726797410733774516424213240813188435922154321511108819176444188185518457225955025510879142933128937566544835525378040039436242357463757111369800670593394434569238912921305016540547229516010929


We tried the exact same test with math/big, and this was not an issue. Can 
someone please take a look at this?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to