View Single Post
jedishrfu
jedishrfu is offline
#5
Dec13-11, 03:40 PM
P: 2,493
you could use the groovy language which can handle Big Integers of arbitrary digit size:

Here's and example script for powers of two:

BigInteger ans = 1g
1000.times { ans=ans*2; println ans }


I run it in the GroovyConsole app and it generates some pretty huge numbers with the last ans being 303 digits long.

Groovy is a scripting lang that extends java with features some wished were in java.

Be aware that handling huge numbers is considerably slower than traditional computer datatypes like int and long or float and double.