324_Book

# These features were added to allow improved

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: g code to compute the correct result. Assume the function u2f returns a ﬂoating-point value having an identical bit representation as its unsigned argument. 88 float fpwr2(int x) CHAPTER 2. REPRESENTING AND MANIPULATING INFORMATION /* Result exponent and significand */ unsigned exp, sig; unsigned u; if (x < ______) /* Too small. Return 0.0 */ exp = ____________; sig = ____________; else if (x < ______) /* Denormalized result */ exp = ____________; sig = ____________; else if (x < ______) /* Normalized result. */ exp = ____________; sig = ____________; else /* Too big. Return +oo */ exp = ____________; sig = ____________; /* Pack exp and sig into 32 bits */ u = exp << 23 | sig; /* Return as float */ return u2f(u); Homework Problem 2.52 [Category 1]: ¾¾ Around 250 B.C., the Greek mathematician Archimedes proved that ¾¾¿ . Had he had access ½ to a computer and the standard library <math.h>, he would have been able to determine that the singleprecision ﬂoating-point approximation of has the h...
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