Message Boards Message Boards

Overflow while computing 10^16 digit

Posted 8 days ago

I have joined you guys because the biggest number Wolfram Mathematica computes is 10^16 digit number, and go bigger than that and it overflows!
Is there any way to compute the first 4, 000 digits of my expression 96717311574016^(8^36 * 14) * 5764801 * 7^3, since that is about 10^20 bigger than the biggest number Mathematica can compute?
I know it isn't possible to see the whole number; it will take me at least BILLIONS OF YEARS to scan over that number! I just need to know how to get the first 4, 000 digits of any number bigger than 8^16, like my expression above. It's like scientific notation with a long number after the decimal. Do I use logarithms?
What's the largest ever number Wolfram alpha can ever compute? This site says it computes answers to arbitrary precision. So does arbitrary in this context mean there's no limit to how big it can go?
Most importantly, how come 8^16 is the biggest number Mathematica can compute and any bigger number overflows?

POSTED BY: Mark Raygorodsky
8 Replies

Then digits is the answer you seek.


As for system limits, multiple-precision ints and floats have to have some sort of data structure. The limits on some of the parameters may depend on the word size. These limits are usually chosen when the gain in efficiency outweighs the limitations on the numbers that may be represented.

Mathematica's multiple-precision arithmetic is based on Gnu's GMP library. There is no limit on the largest integer, other than the memory and time available to the user. The largest real in Mathematica is a little less than 2^2^52 (from Log2@Log2[$MaxNumber]). That seems to imply a 52-bit limit on exponents, but I've never looked into whether that's true of GMP or why such a limit is convenient. I very much doubt it has a connection with any natural dimension, other than it's much greater than what is needed in almost all applications.

POSTED BY: Michael Rogers

our minds are only designed to take in so much info. There is a point when we get overwhelmed/overloaded and we shutdown/dont want to respond to anything and I am guessing the same goes for calculators and computer programs. Our brains cant comprehend such large numbers such as my expression 96717311574016^8^16; it has so many digits I have read up that just memorizing those digits, our matter inside our heads may collapse into a "black hole". It has a few quintillion digits and just reading thru all the digits will take us so long I am talking about at least MILLIONS of YEARS, if not MORE! Our brains can only understand a max of maybe a few hundred digits at the most. There is an article that I read up on that stated that our earth is estimated to be only 10^50 atoms wide. Is that the reason why numbers overflow after a certain point?

POSTED BY: Mark Raygorodsky

I meant the first 4000 digits. The last 4000 digits I figured how to calculate. Just take the rightmost digits and do arithmetic operations with it eg. 8^2. So for the first 4000 digits do I just take the leftmost 4000 digits and do the same thing as I do the rightmost?

POSTED BY: Mark Raygorodsky

Does digits show the first 4000 digits or the last 4000 digits? I would call digits the first 400 4000 digits, but maybe you meant something else.

POSTED BY: Michael Rogers

ok thanks mike! so computing logarithms doesn't work on every single number? I know how to compute a numbers last digits, the first digits are what is extremely hard for me. how do I compute the first 4000 digits of my expression 96717311574016^(8^36 * 14) * 5764801 * 7^3

POSTED BY: Mark Raygorodsky

For the example number you can use logarithms:

(mantissa = 10^FractionalPart@
     N[(8^36*14) Log10[96717311574016] + Log10[5764801] + Log10[7^3],
      {Infinity, 4001}]) // Precision
(*  4000.64  *)

digits = First@RealDigits[mantissa];
Length@digits
(*  4000  *)

If you want to be more certain, increase the accuracy goal, N[..., {Infinity, 4002}] and compute digits = First@RealDigits[mantissa, 10, 4000].

Of course, Log10[x] does not work on an arbitrary number, only ones for which Log10[x] can be represented a1 Log10[x1] + a2 Log10[x2] + ... in Mathematica.

You could try SLI arithmetic. Someone made a stab at it: https://community.wolfram.com/groups/-/m/t/2030201

Not sure the status of that project.

POSTED BY: Michael Rogers

Maybe try giving the base of that power finite precision, say 10000 digits. See what precision the result has.

POSTED BY: Daniel Lichtblau
Posted 8 days ago

Just to be clear, 8^16 is nowhere near the biggest number Mathematica can compute. I think you meant that the max contains 10^16 digits, like you said in your first sentence. You can ask for what the biggest number Mathematica can handle is with $MaxNumber.

As for why, it's obviously because computers have finite memory. Mathematica can't compute a number that it can't actually represent in the memory available on the computer where it's running.

As for how to compute the 4000 leading digits of your number, I think that's more of a math question. Are there algorithms for computing the leading digits of a product without first computing the trailing digits? Seems infeasible to me, but I'm not a mathematician.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract