Range errors

Range errors occur when numbers get ``too big'' or ``too small'' for the precision we are using. For instance, single precision typically gives numbers with 7 significant digits, with a range of $ 10^{\pm
37}$. Therefore, if the numbers we are calculating become larger (smaller) than $ 10^{37}$ ($ 10^{-37}$); errors are going to be introduced into the calculation. Some compilers are quite intelligent and they can introduce code into the executable that do range checking, so that at run-time the program can check for overflow (numbers too big) or underflow (numbers too small) errors. Often, however, if a number gets too small it is represented as zero, and if a number gets too big then unpredictable things can happen, all dependent upon the computer hardware, language (and hence compiler) being used, and other factors.



Paul Cochrane 2002-04-18