All subjects · Computer Science · WCP03 Advanced Principles of Computer Science

Floating point: the IEEE 754 half precision format

Edexcel IAL Computer Science · WCP03 Advanced Principles of Computer Science

Fixed-point binary cannot hold very large and very small numbers at the same time. Floating point solves this, just like scientific notation in denary. Unit 3 uses the IEEE 754 16-bit half precision format.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

The idea

Scientific notation writes 3 450 000 as 3.45 x 106: a significand (3.45) and an exponent (6). Binary floating point does the same with powers of 2: 101.11 = 1.0111 x 22.

A number is normalised when the binary point sits just after the first 1. Every non-zero normalised binary number starts '1.', so IEEE 754 does not store that 1: it is the hidden (implicit) bit, giving one extra bit of precision for free.

The 16-bit half precision layout

IEEE 754 half precision uses 16 bits:

Value = (-1)sign x 1.significand x 2^(stored exponent - 15).

SignExponent (5 bits, bias 15)Significand (10 bits)
0100010111000000

5.75 = 1.0111 x 22: exponent 2 + 15 = 17 = 10001

Special patterns

Benefits and drawbacks

Benefits: a huge range from a small number of bits; numbers of very different sizes in one format; a standard used by all modern hardware, so results match across machines.

Drawbacks: only 11 significant bits (about 3 to 4 denary digits) of precision in half precision; many denary fractions such as 0.1 cannot be stored exactly (rounding errors build up in repeated calculations); arithmetic is slower and more complex than integer arithmetic; testing two floats for exact equality is unreliable.

Trade-off: more exponent bits give more range; more significand bits give more precision. Half precision suits graphics and machine learning, where speed and memory matter more than precision.

Worked example

Write 5.75 in IEEE 754 half precision.

  1. Sign: positive, so 0.
  2. 5.75 = 4 + 1 + 0.5 + 0.25 = 101.11 in binary.
  3. Normalise: 101.11 = 1.0111 x 22.
  4. Exponent: 2 + 15 = 17 = 10001.
  5. Significand: the bits after the point, 0111, padded to 10 bits: 0111000000.

Answer: 0 10001 0111000000

Key idea: 16 bits = 1 sign + 5 exponent (bias 15) + 10 significand with a hidden leading 1. Value = (-1)s x 1.f x 2e - 15. More exponent bits: range; more significand bits: precision.

Check yourself

  1. What is the exponent bias in IEEE 754 half precision?
    Show answer

    15. Bias = 25 - 1 - 1 = 15.

  2. A normalised number is 1.101 x 24. What denary value is stored in the 5-bit exponent field?
    Show answer

    19. Stored = true exponent + bias = 4 + 15 = 19 (10011).

  3. The stored exponent field is 01100. What is the true exponent?
    Show answer

    -3. 01100 = 12; 12 - 15 = -3.

  4. Why is the leading 1 of the significand not stored?
    • It is stored in the sign bit instead
    • Every normalised non-zero number starts with 1, so storing it would waste a bit
    • It is always 0
    • It is stored in the exponent
    Show answer

    Every normalised non-zero number starts with 1, so storing it would waste a bit. The hidden bit gives an extra bit of precision.

  5. Which bit pattern starts a negative half precision number?
    • A sign bit of 0
    • An exponent of 11111
    • A significand of all 1s
    • A sign bit of 1
    Show answer

    A sign bit of 1. The first bit is the sign: 1 for negative.

  6. What is the largest finite value in IEEE 754 half precision?
    Show answer

    65504. Exponent 11110 = 30, true exponent 15; significand all 1s: (2 - 2-10) x 215 = 65504.

  7. A format moves one bit from the significand to the exponent. What is the effect?
    • Greater precision but less range
    • Greater range and greater precision
    • No change in range or precision
    • Greater range but less precision
    Show answer

    Greater range but less precision. Exponent bits set range; significand bits set precision.

  8. Why can 0.1 not be stored exactly in binary floating point?
    • 0.1 is too large for the exponent
    • Floating point cannot store numbers below 1
    • 0.1 is a recurring fraction in binary, so it must be rounded to the nearest representable value
    • 0.1 needs a negative sign bit
    Show answer

    0.1 is a recurring fraction in binary, so it must be rounded to the nearest representable value. 0.1 = 0.000110011... in binary; half precision stores 0.0999755859375.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.