Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program or library to handle massive numbers [closed]

Tags:

java

python

math

I am looking for some way to handle numbers that are in the tens of millions of digits and can do math at this level. I can use Java and a bit of Python. So a library for one of these would be handy, but a program that can handle these kind of numbers would also work. Does anyone have any suggestions?

Thanks

like image 610
Qor Avatar asked Dec 12 '22 20:12

Qor


1 Answers

For Java, take a look at the built-in classes BigInteger and BigDecimal. BigInteger numbers are limited in size by available memory. BigDecimal can represent arbitrarily large base-10 numbers with up to 232 digits to the right of the decimal point (in practical terms, also limited by available memory).

Both of these are limited to fairly elementary math operations. (Arithmetic, integer powers, etc. No roots, logs, etc.) If you need something more than this, consult the list of libraries at the Java Numerics page of NIST. (The Apfloat package supports arbitrary-precision transcendental functions and complex math.)

like image 64
Ted Hopp Avatar answered Dec 14 '22 10:12

Ted Hopp