Dale - Computer Science Illuminated 89

Dale - Computer Science Illuminated 89 - 62 Chapter 3 Data...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Scientific notation An alternative floating-point representation Table 3.1 Values in decimal notation and floating-point notation (five digits) Real Value Floating-Point Value 12001.00 –120.01 0.12000 –123.1 1555555555 12001* –12001* 1200* –12310* 15555* 10 0 10 3 10 2 10 –5 10 –2 62 Chapter 3 Data Representation positive exponent shifts the decimal point to the right, and a negative exponent shifts the decimal point to the left. Let’s look at how to convert a real number expressed in our usual decimal notation into floating point. For example, consider the number 148.69. The sign is positive, and there are two digits to the right of the decimal point. Thus, the exponent is ± 2, giving us 14869 * 10 ± 2 . Table 3.1 shows other examples. For the sake of this discussion, we assume that only five digits can be represented. How do we convert a value in floating-point form back into decimal notation? The exponent on the base tells us how many positions to move the radix point. If the exponent is negative, we move the radix point to the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online