Comments on: Question of the Week: How can computers calculate exponential math without overflow errors? The Super User Community Blog Mon, 05 Dec 2016 07:34:06 +0000 hourly 1 By: Fox Tue, 31 Jul 2012 20:52:25 +0000 Whoops. I see this was answered in greater depth in the second half of the OP.

]]> By: Fox Tue, 31 Jul 2012 20:42:21 +0000 The calculations are handled by software (sometimes native data types) that can deal with numbers of arbitrary length. These are commonly referred to as “BigDecimal” or “BigInteger” (though I wouldn’t be surprised if some large but bounded systems used these names as well).

]]> By: Dennis Mon, 30 Jul 2012 11:27:47 +0000 @sblair is correct: This has nothing to do with Stack Overflow.

The concern here is integer overflow, since the maximum representable value of a 64-bit register is 2 ^ 64 – 1 = 18,446,744,073,709,551,615.

In contrast, the result of 855 ^ 2753 would need 23,814 bits to be represented.

By: sblair Mon, 30 Jul 2012 09:45:14 +0000 I don’t think this has anything to do with a stack overflow. It is simply that the numerical range of 64-bit IEEE 754 floating point numbers isn’t large enough to contain 855^2753. The possible range is approximately −10^308 to +10^308.

]]> By: Torleif Mon, 30 Jul 2012 08:59:23 +0000 For the beginning of this post, isn’t ‘stack overflow’ something else than the ‘overflow’ mentioned here? As far as I know, ‘Stack overflow’ is when there have been too many method calls (infinite call loop for example), while a regular overflow in this context is when you have a number which is too big for a 32/64-bit integer and it overflows, either by ‘looping around’ or failing or whatever.