Storing Floating-point Numbers



Floating-point numbers are represented in memory using three fields.  The first field is the sign bit.  If the sign bit is 1, the number is negative.  The next field is the exponent field, used to store the number’s exponent. The last field is called the mantissa, used to store the coefficient.

The format for floating-point numbers is basically the same as the format for scientific notation.  For example -1016.956 would be -1.016956 x 103 in scientific notation.   Since the number is negative, 1 would be stored in the sign bit.   The exponent field would contain the binary representation of  3, and the mantissa field would contain a binary form of 1016956.

A 4 byte floating-point number is stored in following format.  

Back to Chapter 4 Topics