- The format of a floating-point number
Value = mantissa × 2^exponent, with both parts in two's complement.
An integer can be stored in a fixed number of bits, but a real number (one with a fractional part, like 3.75 or −0.5) needs a different scheme. 9618 uses floating-point representation:
value = mantissa × 2^exponent
The bit pattern is split into two fields, and both are stored in two's complement:
- The mantissa holds the significant digits as a fraction. The binary point lies just after the sign bit, so the bits after it are worth The sign bit before the point is worth −1.
- The exponent is a whole number (two's complement) giving the power of 2 — it says how far to move the binary point.
The name "floating-point" comes from the fact that the binary point can float to different positions, set by the exponent — unlike a fixed-point number where the point never moves.
- value = mantissa × 2^exponent.
- Both mantissa and exponent are stored in two's complement.
- Mantissa = fraction; point is after the sign bit (bits worth 1/2, 1/4, …).
- Mantissa sign bit is worth −1; exponent gives the power of 2.
See the full worked example for floating-point numbers, representation and manipulation →