25
$\begingroup$

On my calculator, I usually get a $0$ when I divide something by $2$, a lot of times if that makes sense, but I was just wondering why does $2^{-329} = 0?$

$\endgroup$
  • 34
    $\begingroup$ It doesn't. Calculators round. $\endgroup$ – anon Oct 5 '13 at 8:15
  • 13
    $\begingroup$ Consider that if $2^{-329}$ was zero, then $2^{-329} \times 2 = 2^{-328}$ would have to be zero too. And by the same logic $2^{-327}, 2^{-326}, \cdots 2^{0}$ would have to be as well. But $2^0 = 1$, contradiction. $\endgroup$ – Thomas Oct 5 '13 at 13:41
  • 2
    $\begingroup$ About $9.14\times10^{-100}$, I think maybe it's because the exponent field display of a typical LCD calculator can only show down to $-99$? $\endgroup$ – Alvin Wong Oct 5 '13 at 15:20
  • 8
    $\begingroup$ I'm amazed that NOT ONE of the six answers so far has used the word "round". Students often think calculators give EXACT answers whereas things done by hand are rounded. That's the opposite of the truth. All the confusion about arithmetic that's out there will persist until simple things are taught, one of which is that CALCULATORS ROUND. +1 to "anon"'s comment. $\endgroup$ – Michael Hardy Oct 5 '13 at 21:56
  • 1
    $\begingroup$ @wendy.krieger Yes, but in some strict sense, rounding is the process by which the closest representable number is selected; so underflow is rounding to 0, but not in the usual way when mantissa needs to be truncated. $\endgroup$ – Kirill Oct 6 '13 at 0:32
51
$\begingroup$

The precise name for the feature is underflow, which means it's less than the smallest number the registers can hold. It's kind of like overflow.

$\endgroup$
  • 4
    $\begingroup$ I really love the fact that this uses the word, "feature" $\endgroup$ – Guy Mar 27 '14 at 16:39
32
$\begingroup$

It doesn't. Your calculator can't handle a number of such a small magnitude. Specifically, $2^{-329}\approx 9.14\times 10^{-100}$, and I'm guessing that your calculator can only handle numbers of magnitude between $10^{-99}$ and $10^{99}$.

$\endgroup$
  • 1
    $\begingroup$ In contrast, IEEE double precision can represent the answer correctly (and exactly). $\endgroup$ – Dan Oct 5 '13 at 14:51
  • $\begingroup$ @Dan, that's true, the smallest number it can represent exactly is 2^−1074 $\endgroup$ – travisbartley Oct 7 '13 at 6:28
28
$\begingroup$

Your calculator gives you $0$ for $2^{-329}$ for the same reason that it gives you $0$ when you divide by $2$ a lot: Because $2^{-329}$ is dividing by $2$ a lot. More precisely,

$$2^{-329}=\dfrac{1}{2^{329}}=\dfrac{1}{\text{huge number}}=\text{number so small your calculator doesn't know it from }0.$$

Note that $2^{-329}$ is what you get if you start with $1$ and divide by $2$ repeatedly, a total of $329$ times.

$\endgroup$
9
$\begingroup$

The calculator doesn't have enough precision to store the number which is so small that the closest number it can represent is 0.

Similarly, the same thing happens when you try repeatedly square rooting a number on your calculator.

I.e. pick any positive number $n$ and evaluate $\sqrt{\sqrt{\sqrt{...\sqrt{\sqrt{n}}}}}$. You'll find the calculator eventually returns $1.0$ when you do it enough times.

$\endgroup$
9
$\begingroup$

You know from your algebra course (hopefully) that $2^x \neq 0$ for any $x$, so this has something to do with calculator doing something in appropriate. You were probably expecting something in scientific notation: $$ 2^{-329} = a \cdot 10^b $$ for some $1 \leq a < 10$ and an integer $b$ (so that neither the right hand side nor the left hand side are zeroes, of course). Can you still compute this on your calculator? In your algebra class, you should have learned a trick to make insanely big (or insanely small, like this one) numbers manageable. Let's put this trick to action: $$ b + \log_{10} a = \log_{10} 2^{-329} = -329 \log_{10} 2 = -329 \cdot 0.30103 = -99.038869 $$ If $1 \leq a < 10$, then $0 \leq \log_{10} a < 1$. So $b$ is the integer floor part of the answer, and $\log_{10} a$ is the fractional part: $$ b = -100; \log_{10} a = 1 - 0.038869 = 0.961131; a = 10^{0.0.961131} = 9.14389 $$ Thus, $$ 2^{-329} = 9.14389 \cdot 10^{-100} $$ as of course pointed out by everybody else in this thread.

Calculator is your (powerful) tool, but you still need to be smart in using that tool.

$\endgroup$
  • 1
    $\begingroup$ +1, even though probably useless to the person who asked. $\endgroup$ – Carsten S Oct 6 '13 at 10:48
1
$\begingroup$

Because, the calculator has a limit, and the input of yours crosses that limit. Your calculator calculates the value for the positive index first and then inverses it. Hence, it's underflowing its register values.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.