How do computers store fractional and very large numbers, and why is floating-point arithmetic only approximate?
Explain floating-point representation in terms of sign, mantissa and exponent, and discuss precision, range and rounding error
A focused answer to the H2 Computing outcome on floating point. The sign, mantissa and exponent fields, normalisation, the trade-off between precision and range, and why rounding errors arise.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
SEAB wants you to explain how a fractional or very large number is stored as a sign, a mantissa and an exponent, what normalising the mantissa achieves, and why floating point trades precision against range and inevitably introduces rounding error. The core idea mirrors scientific notation: store the significant digits separately from a scale factor.
The answer
The three fields
A floating-point number splits a fixed number of bits into three parts:
- Sign - one bit, 0 for positive and 1 for negative.
- Mantissa (significand) - the significant binary digits of the value, stored as a fraction.
- Exponent - a signed power of two that scales the mantissa, deciding where the binary point falls.
The value is, in effect:
This is binary scientific notation: the mantissa carries accuracy, the exponent carries magnitude.
Normalisation
A value can be written many ways - equals . Normalising fixes a single convention, typically shifting the mantissa so the first significant bit sits immediately after the binary point and adjusting the exponent to match. This gives a unique representation and spends every mantissa bit on real precision rather than leading zeros.
Precision versus range
The split of bits is a fixed budget:
- More mantissa bits give more significant figures, so finer precision.
- More exponent bits give a larger spread of magnitudes, so wider range.
You cannot increase both within a fixed width; moving bits one way costs the other. This is the central design trade-off of any floating-point format.
Why rounding error is unavoidable
Most denary fractions are recurring in binary. For example repeats forever. With only a finite mantissa, the pattern is truncated or rounded, so the stored value is close but not exact. These tiny errors accumulate over many operations.
Examples in context
Example 1. Scientific computing. A physics simulation may need to represent both atomic distances and astronomical ones. A wide exponent lets a single format span those magnitudes, while the mantissa keeps each value accurate to several significant figures - exactly the range-versus-precision balance the format designers chose.
Example 2. Financial software avoids floats. Because does not give exactly in binary floating point, banking systems store money as integer cents (or use a fixed-point or decimal type). This sidesteps accumulated rounding error that would otherwise leave accounts off by a fraction of a cent.
Try this
Q1. State the role of the exponent field in a floating-point number. [1 mark]
- Cue. It scales the mantissa by a power of two, setting the magnitude and the position of the binary point.
Q2. Explain what normalising a mantissa achieves. [2 marks]
- Cue. It removes leading zeros to give a unique representation and uses all mantissa bits for significant figures, maximising precision.
Q3. A format gains two extra exponent bits taken from the mantissa. State the effect on range and precision. [2 marks]
- Cue. Range increases (larger magnitudes representable) but precision falls (fewer significant bits in the mantissa).
Exam-style practice questions
Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Original5 marksA floating-point format uses 1 sign bit, a 5-bit exponent and a 6-bit normalised mantissa. (a) Explain the purpose of each of the three fields. (b) Describe what normalising the mantissa achieves. (c) State the trade-off if more bits are moved from the mantissa to the exponent.Show worked answer →
(a) The sign bit gives the number's sign (0 positive, 1 negative). The mantissa (also called the significand) holds the significant digits of the value as a binary fraction. The exponent scales the mantissa by a power of two, fixing where the binary point sits.
(b) Normalising shifts the mantissa so that there is a single leading non-zero digit just before (or just after, depending on convention) the binary point, and adjusts the exponent to compensate. This gives every value a unique representation and uses every mantissa bit for precision rather than wasting them on leading zeros.
(c) Moving bits from the mantissa to the exponent increases the range of magnitudes that can be represented but reduces precision, because fewer significant bits remain. It is a direct trade-off between how large and how accurate the numbers can be.
Markers reward a correct role for each field, that normalisation removes leading zeros and gives a unique form, and the explicit range-versus-precision trade-off.
Original4 marksExplain why the denary value cannot be stored exactly in a binary floating-point number, and describe one consequence this has for a program that adds many such values.Show worked answer →
In binary, is a recurring fraction: , repeating forever, just as one third recurs in denary. A floating-point mantissa has only a fixed number of bits, so the recurring pattern must be truncated or rounded, leaving a stored value slightly different from .
A consequence is accumulated rounding error. If a program adds ten thousand times, each addition carries a tiny error and the errors build up, so the total may be visibly different from the expected . This is why money is often stored in integer cents and why equality tests on floating-point results should use a tolerance rather than exact comparison.
Markers reward the recurring-binary-fraction explanation, that a finite mantissa forces rounding, and a sensible consequence such as accumulated error or unreliable equality tests.
Related dot points
- Convert whole numbers between binary, denary and hexadecimal, and perform binary addition, explaining the role of place value and overflow
A focused answer to the H2 Computing outcome on number bases. Place value in binary and hexadecimal, conversion methods between binary, denary and hexadecimal, binary addition, and the meaning of overflow.
- Represent signed integers using two's complement, convert to and from denary, and perform subtraction by addition, explaining range and overflow
A focused answer to the H2 Computing outcome on signed integers. Two's complement encoding, converting to and from denary, subtraction as addition, the representable range, and detecting signed overflow.
- Apply bitwise AND, OR, XOR, NOT and shift operations, and use masks to set, clear, toggle and test individual bits
A focused answer to the H2 Computing outcome on bitwise operations. The AND, OR, XOR and NOT operators, left and right shifts, and using masks to set, clear, toggle and test individual bits.
- Analyse the time and space complexity of an algorithm using Big-O notation, and compare common growth rates
A focused answer to the H2 Computing outcome on algorithmic complexity. Big-O notation, deriving the order of growth from loops and recursion, the common complexity classes, and the trade-off between time and space.
- Design test cases using normal, boundary and erroneous data, distinguish levels of testing, and apply systematic debugging techniques
A focused answer to the H2 Computing outcome on testing and debugging. Choosing normal, boundary and erroneous test data, unit and integration and system testing, black-box versus white-box, and systematic debugging.