IEEE single-precision floating-point format

Real values are stored in a 4-byte number. Those 4 bytes (32 bits) are divided into 3 fields of bits: The sign bit, the (binary) exponent, and the (binary) mantissa.

I will refer to the values in those bit fields as the binary values. I will refer to the sign, exponent and mantissa as one normally thinks of them in a programming language, or in scientific notation, as mathematical values or decimal values.

For example, -3.14e-05 has binary sign bit 1, exponent bits 0x70, and mantissa bits 0x03b37e. Yet of course one thinks mathematically of -3.14e-05 as having sign -1, exponent -5, and mantissa 3.14.


Bit fields

An IEEE single-precision float has 1 sign bit, 8 exponent bits, and 23 mantissa bits:


Representable values

The purpose of the sign bit is self-explanatory. Here are the values that can be represented with various values in the exponent and mantissa fields: