This program should run on any machine regardless of

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ate to 0.0—the value 3.14 would be lost due to rounding. On the other hand, the expression 3.14+(1e10-1e10) would evaluate to 3.14. As with an Abelian group, most values have inverses under floating-point addition, that is, Ü +f Ü ¼. The exceptions are infinities (since ·½ ½ Æ Æ ), and Æ Æ ’s, since Æ Æ +f Ü Æ Æ for any Ü. The lack of associativity in floating-point addition is the most important group property that is lacking. It has important implications for scientific programmers and compiler writers. For example, suppose a compiler is given the following code fragment: x = a + b + c; y = b + c + d; The compiler might be tempted to save one floating-point addition by generating the code: t = b + c; 2.4. FLOATING POINT x = a + t; y = t + d; 77 However, this computation might yield a different value for x than would the original, since it uses a different association of the addition operations. In most applications, the difference would be so small as to be inconsequential. Unfortunately, compilers have no way of knowing what trade-offs...
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.

Ask a homework question - tutors are online