require ‘bigdecimal’

x=(Math.sqrt(9999999999999999*9999999999999999))

=> 100000000000000.0. #wrong! Should be 9999999999999999

Puts x*x

=> 1.0e+32

Puts “%d” % (x*x)

=> 1000000000000009999999988654363748

I have been performing math with large numbers… This seems to be

limited by the hardware and operating system for what size a number can

be accurately processed… the example above shows at what point my

android device fails to provide accurate results…

are there any libs that can accurately process insanely large numbers?

Maybe Bigdecimal can but I’m using it wrong?