2017-07-22 16:48 GMT+02:00 me <yout...@z505.com>: > How does GoLang compare to other languages for mathematics dealing with > really large numbers? > > Prefer the ability to work with 2GB sized strings as numbers (need much > bigger than int64) > > I see there is this: > https://golang.org/pkg/math/big/ > > And probably some other github projects for math in go? > > Is Python and Mathematica better at handling super large numbers? Plain C? > C++ ? Javascript? > > I need to start working with some massive numbers, but am unsure to choose > Go - as I don't have experience in Go Mathematics units yet. >
math/big is the standard package for big integer arithmetic in Go, and it is quite fast. For your huge numbers, it all depends on which operations you need to do. For example, the math/big package uses Karatsuba multiplication, which cannot handle 2GB numbers in a reasonable amount of time. I wrote a little module (github/remyoudompheng/bigfft) to play with FFT-based multiplication of huge integers, while maintaining interoperability with the math/big package. On my computer, it multiplies 1Gbit numbers (300MB strings when printed in base 10), in 24 seconds (the GMP library does it in 9.3 seconds). I assume that it would multiply your 2GB strings (6 Gbit numbers) in about 2 minutes. You are welcome to try it. Regards, Rémy. -- 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.