Integer representations cannot store very large numbers or fractions precisely. Floating-point stores a wide range of real numbers by separating the value into two parts: a mantissa (significant digits) and an exponent (scale factor).
A floating-point number is written as: mantissa × 2^exponent (binary). The layout in memory divides the available bits between mantissa and exponent.
| Component | Purpose | More bits = |
|---|---|---|
| Mantissa | Stores the significant digits (precision) | Greater precision, fewer rounding errors |
| Exponent | Stores the power of 2 (scale) | Greater range (larger/smaller numbers) |
To maximise precision, floating-point numbers are stored in normalised form. For a positive normalised number, the mantissa must start with 0.1 (binary point then leading 1). For a negative normalised number, it must start with 1.0.
This ensures the full precision of the mantissa is used — there are no leading wasted zeros.
| Mantissa (8 bits, two's comp) | Exponent (4 bits, two's comp) | Value |
|---|---|---|
| 0.1011000 | 0011 (+3) | 0.1011 × 2³ = 1011.0 = 11₁₀ |
| 1.0100000 | 0010 (+2) | Negative normalised; value = −6₁₀ |
Whole part by division; fractional part by repeated multiplication by 2, reading the integer parts downward.
Example: 0.375₁₀ → 0.011₂ (0.375×2=0.75→0; 0.75×2=1.5→1; 0.5×2=1.0→1)
Move binary point to get 0.1... (positive) or 1.0... (negative); count shifts to find exponent.
0.011₂ → shift left 1 → 0.11 × 2⁻¹ — but this needs another shift: 0.11 still starts 0.1 so it is already normalised.
| More mantissa bits | More exponent bits |
|---|---|
| Higher precision (more significant figures) | Larger range of values |
| Smaller range of values | Lower precision |
With a fixed total number of bits, increasing mantissa size reduces exponent size and vice versa. This is the key design trade-off.
Many decimal fractions cannot be represented exactly in binary floating-point (e.g. 0.1 in decimal has no exact binary representation). This causes rounding errors. Accumulated errors in long calculations can cause significant inaccuracies — important in scientific and financial computing.
Example: in Python, 0.1 + 0.2 ≠ 0.3 exactly due to floating-point imprecision.
8 questions · instantly marked · AQA 7517 standard
| Term | Definition |
|---|
10 questions · 10 minutes