This preview shows page 1. Sign up to view the full content.
Unformatted text preview: and double-precision ﬂoating point. In addition, the machines use the round-to-even rounding mode. Unfortunately, since the C standard does require the machine use IEEE ﬂoating point, there are no standard methods to change the rounding mode or to get special values such as ¼, ·½, ½, or Æ Æ . Most systems provide a combination of include (‘.h’) ﬁles and procedure libraries to provide access to these features, but the details vary from one system to another. For example, the GNU compiler GCC deﬁnes macros INFINITY (for ·½) and NAN (for Æ Æ ) when the following sequence occurs in the program ﬁle:
#define _GNU_SOURCE 1 78
#include <math.h> CHAPTER 2. REPRESENTING AND MANIPULATING INFORMATION Practice Problem 2.27: Fill in the following macro deﬁnitions to generate the double-precision values ·½, ½, and ¼. #define POS_INFINITY #define NEG_INFINITY #define NEG_ZERO #endif You cannot use any include ﬁles (such as math.h), but you can make use of the fact that...
View Full Document
- Spring '10
- The American