Dale - Computer Science Illuminated 85

# Dale - Computer Science Illuminated 85 - 58 Chapter 3 Data...

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

58 Chapter 3 Data Representation decimal system, a sign (+ or ± ) is placed before a number’s value, though the positive sign is often assumed. The sign represents the ordering, and the digits represent the magnitude of the number. The classic number line looks something like this, in which a negative sign meant that the number was to the left of zero and the positive number was to the right of zero. Performing addition and subtraction with signed integer numbers can be described as moving a certain number of units in one direction or another. To add two numbers you find the first number on the scale and move in the direction of the sign of the second as many units as specified. Subtrac- tion was done in a similar way, moving along the number line as dictated by the sign and the operation. In grade school you soon graduated to doing addition and subtraction without using the number line. There is a problem with the sign-magnitude representation: There are two representations of zero. There is plus zero and minus zero. The idea of
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online