Friday, June 24, 2011

Practice for underflow and overflow in scientific notation.



Here is a link to a previous post about scientific notation, underflow and overflow.

Consider 80^80.  If you enter this into your calculator, you will likely get an overflow error because the answer is more than 10^100.  Here is how we can get around this, by splitting the number into two parts that are less than 10^100 and multiplying them together.

80^40 = 1.329227996 x 10^76

If we multiply 80^40 by 80^40, we will get 80^80.  We need to square 1.329227996 to get the new significand, and the new exponent will be 10^(76+76) = 10^152

1.32922² = 1.766825808..., but since we only squared the number with six significant digits, we can only trust the answer to five significant digits, so our best answer is 1.7668 x 10^152.


More practice.

a) 40^80

b)40^-80

Answers in the comments.

1 comment:

Prof. Hubbard said...

a) 40^80

40^40 = 1.20882...x 10^64

1.20882² = 1.4612457..., but we can only rely on the first five digits, 1.4612

64+64 = 128

40^80 = 1.4612 x 10^128, to five significant digits.

b)40^-80

40^-40 = 8.271806...x10^-65

-65 + -65 = -130
8.271806² = 68.4227745, which is more than 10, so we change it to 6.8423 x 10^1

6.8423 x 10^1 x 10^-130 =
6.8423 x 10^-129, to five significant digits.