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
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.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With