324_Book

# 80 chapter 2 representing and manipulating

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: o a whole number. We simply consider whether the least signiﬁcant digit is even or odd. For example, suppose we want to round decimal numbers to the nearest hundredth. We would round 1.2349999 to 1.23 and 1.2350001 to 1.24, regardless of rounding mode, since they are not halfway between 1.23 and 1.24. On the other hand, we would round both 1.2350000 and 1.2450000 to 1.24, since four is even. 76 CHAPTER 2. REPRESENTING AND MANIPULATING INFORMATION Similarly, round-to-even rounding can be applied to binary fractional numbers. We consider least signiﬁcant bit value 0 to be even and 1 to be odd. In general, the rounding mode is only signiﬁcant when we have a bit pattern of the form ¡¡¡ ¡ ¡ ¡ ½¼¼ ¡ ¡ ¡, where and denote arbitary bit values with the rightmost being the position to which we wish to round. Only bit patterns of this form denote values that are halfway between two possible results. As examples, consider the problem of rounding values to ¿ the nearest quarter (i.e., 2 bits to the right of the binary point). We would round ½¼ ¼¼¼½½¾ (...
View Full Document

Ask a homework question - tutors are online