Explanation on why this gives overflow?


If you have a phrase like $10^{0.00057 \cdot 10^{42}}$ that gives "overflow", what is the reason? Is it because, well, something about the size of this whole thing?


Posted 2021-02-08T19:20:41.183

Reputation: 105

I'm looking for kind of a philosophical answer. What is it about, maybe, floating point arithmetic or some other computer coding issue that makes this "overflow." – Abcderia – 2021-02-08T19:21:45.783

2The maximum machine number can be printed by: $MaxMachineNumber, approx. 10^308. Compare this to your number of "tiny size", approx 10^10^39 – Daniel Huber – 2021-02-08T19:41:45.443

Helpful. I guess I didn't track that my "tiny size" was equal to 10^10^39. More importantly what is the max machine number 10^308 and not something larger, or without a maximum at all? – Abcderia – 2021-02-08T19:47:00.497

3Machine numbers are on most systems 64-bit floating point numbers, which have a mantissa of 53 bits, an exponent of 11 bits, and 1 sign bit (the last bit of the mantissa is implied). The 11 bits of the exponent allow a representation of $2^{-1024}$ to $2^{1024}$, roughly. $2^{1024}$ is roughly $10^{308}$. See the Wikipedia page on "Floating-point arithmetic" for details. – eyorble – 2021-02-08T19:50:17.627


I do not understand your question. Machine numbers are only a finite number of points in the endless sea of real numbers. And because there is only a finite number, there is a number of maximal size. Maybe the beginning of "https://en.wikipedia.org/wiki/Floating-point_arithmetic" may be of interest.

– Daniel Huber – 2021-02-08T19:56:00.980

This is a good reference for how Mathematica deals with numbers: https://reference.wolfram.com/language/tutorial/Numbers.html

– Simon Woods – 2021-02-08T21:36:43.983

3Re: why 10^308 and not something bigger. Answer: If you want to use the really fast hardware floating point math built into your CPU then you get the speed and you accept the limitations that it has in terms of exponent size, mantissa size, etc. If you want hundreds of times slower software floating point built into Mathematica then you take the extra steps to tell Mathematica this is not a hardware floating point number and you get greater range of exponent and mantissa. Choice is yours, all you have to do is to understand how you are telling it which you want to use. Does that help? – Bill – 2021-02-08T21:47:25.417


Instead of $MaxMachineNumber, the limit for Overflow[] is $MaxNumber, which is around 10^m with m = 1.5 * 10^15, or in base 2, a little under 2.^2^52, much smaller than your number. When you get machine overflow, the computation is automatically converted to arbitrary precision numbers, which have this hard limit on their size. I don't know why. Often imposing limitations allows for optimizations not possible in unlimited computations.

– Michael E2 – 2021-02-09T16:54:41.290

No answers