This preview shows page 1. Sign up to view the full content.
Unformatted text preview: s properties quite different from conventional integer and real arithmetic. The ﬁnite length can cause numbers to overﬂow, when they exceed the range of the representation. Floating point values can also underﬂow, when they are so close to ¼ ¼ that they are changed to zero. The ﬁnite integer arithmetic implemented by C, as well as most other programming languages, has some peculiar properties compared to true integer arithmetic. For example, the expression x*x can evaluate to a negative number due to overﬂow. Nonetheless, both unsigned and two’s complement arithmetic satisﬁes the properties of a ring. This allows compilers to do many optimizations. For example, in replacing the expression 7*x by (x<<3)x, we make use of the associative, commutative and distributive properties, along with the relationship between shifting and multiplying by powers of two. 80 CHAPTER 2. REPRESENTING AND MANIPULATING INFORMATION Floating point representations approximate real numbers by encoding numbers of the form Ü ¢ ¾Ý . The...
View
Full
Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
 Spring '10
 Schultz
 The American, Gulliver's Travels, 2.2.5 2.2.6 2.2.7 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5

Click to edit the document details