Section 21.2: Encoding Real Numbers as Floating Point Numbers (Frame 6)                     [prev][home][     ]

Here's how the mass of the hydrogen atom was encoded. First, 1.67339 can't be stored in 5 digits; our mantissa cannot be that large, so we round up the mantissa to 1.6734. Next, we change 1.6734×10-24 so that the mantissa is between 0 and 1.0 exclusive; hence 0.16734×10-23. Notice that we can multiply any number by 1 and not change its value. Since 1 = 10/10, we can both multiply the number by 10 and divide by 10. Since the number is actually a product of the mantissa and the exponent, we can multiply one part by 10 while dividing the other part by 10. So we choose to divide the mantissa by 10 (shift the decimal point one place to the left) and multiply the exponent by 10 (add 1 to -24 and getting -23). Finally, the exponent is negative, so we subtract the absolute value of the exponent from 50: 50-23=27.