TutorChase logo
Login
AQA A-Level Computer Science

5.1.5 Real numbers (ℝ)

Real numbers represent all possible quantities along the number line, combining both rational and irrational values to support measurement, modelling, and scientific computation in computing.

What are real numbers?

Real numbers, written as , form one of the most comprehensive number sets in mathematics. They include every number that can be represented on a number line — from simple integers and fractions to non-repeating decimals that stretch on infinitely. Real numbers can be used to describe continuous quantities, such as weight, height, temperature, speed, and time.

More formally, real numbers are defined as the union of rational numbers and irrational numbers. This means every number that is either a fraction (or can be written as one), or a decimal with no repeating or ending pattern, is a real number.

Computers use real numbers to measure, calculate, approximate, and simulate values from the real world. Without real numbers, it would be impossible to carry out tasks such as modelling temperature fluctuations, rendering realistic graphics, or calculating the result of scientific formulas.

Types of numbers included in ℝ

To understand what makes up the set of real numbers, it's important to look at its two main components: rational numbers and irrational numbers.

Rational numbers

Rational numbers are numbers that can be expressed in the form a / b, where a and b are integers and b is not equal to 0.

Examples include:

Take your grades to the next level!

UPGRADING TO PREMIUM UNLOCKS
AI Tutor
AI-powered study assistant
instant feedback and guidance
Predicted Papers
Examiner-style predicted papers
based on recent exam trends
Practice Questions
All exam practice questions
by topic for each subject
Study Notes
All detailed revision notes
written by expert teachers
Cheat Sheets
Quick revision summaries
perfect for last-minute review
Past Papers
Complete collection
of practice and past exam papers
Email
Password
Confirm Password
Already have an account?

Practice Questions

FAQ

Some decimal numbers, like 0.1 or 0.2, cannot be represented exactly in binary because their fractional parts are repeating when converted to base 2. In base 10, 0.1 is a simple one-decimal-digit number, but in binary, it becomes a repeating sequence: 0.0001100110011..., continuing infinitely. Since computers store numbers using a fixed number of binary bits, they must round this repeating sequence at some point. This rounding leads to small inaccuracies known as floating-point errors. These errors are usually very small, but they can accumulate in calculations, especially when performing many operations or comparisons. This limitation is not due to a programming language or hardware fault but is a direct consequence of how number systems work. Floating-point formats such as IEEE 754 are designed to maximise range and performance, not exact precision for every number. For applications requiring exact decimal precision, such as financial systems, alternative number types like fixed-point or decimal types are often used.

Machine epsilon is the smallest positive number that, when added to 1.0 in a computer system, results in a value distinguishable from 1.0. It provides a measure of how precise the floating-point representation is on a particular system. In other words, it defines the smallest gap between two distinct representable real numbers in a floating-point system. For most 64-bit double-precision systems, machine epsilon is approximately 2.22 × 10^-16. This value helps programmers understand the limits of precision and rounding in floating-point arithmetic. When comparing real numbers, using machine epsilon as a threshold helps avoid problems caused by minor differences that result from floating-point rounding errors. For example, instead of checking if a == b, it’s more accurate to check if the absolute difference between them is less than epsilon. Machine epsilon is fundamental to understanding numerical stability and the reliability of real number operations in software, particularly in simulations, scientific calculations, and numerical methods.

Denormalisation occurs when very small real numbers are too close to zero to be represented using the normalised floating-point format. In normal representation, the number is stored with a leading 1 in its binary form. However, when values are too small for this, denormal or subnormal numbers are used, which allow the number to have leading zeros in the significand. This enables representation of numbers closer to zero than what normalised floating-point numbers allow. While this extends the range of representable real numbers, it comes at the cost of precision. Denormal numbers have fewer significant bits, meaning they are less precise and operations involving them are slower on some processors. Subnormal numbers are essential in ensuring gradual underflow, preventing sudden jumps to zero, which could cause larger errors in sensitive calculations. However, their use should be monitored in performance-critical applications where precision and speed are essential.

IEEE 754 includes representations for special real number cases that go beyond typical finite values. These include positive infinity (+∞), negative infinity (−∞), and NaN (Not a Number). Infinity is used when a number grows beyond the largest representable value or as the result of operations like dividing a non-zero value by zero. For example, 1.0 divided by 0.0 yields +∞. Negative values divided by zero yield −∞. NaN is used to represent undefined or unrepresentable results, such as 0.0 divided by 0.0 or the square root of a negative number in real arithmetic. These values follow specific propagation rules in arithmetic operations — for example, any operation involving NaN typically returns NaN. This behaviour is crucial for debugging and for avoiding crashes during computations. The presence of these special cases allows floating-point systems to deal with errors gracefully, providing mechanisms to detect and handle exceptional numerical conditions in software.

Cancellation error occurs when two nearly equal real numbers are subtracted, resulting in a significant loss of precision. This is because the leading digits cancel out, leaving only the less significant — and less precise — bits in the result. For instance, subtracting 1.0000001 and 1.0000000 gives 0.0000001, which has far fewer significant digits than the original numbers. In floating-point arithmetic, this can lead to results that are less accurate than expected, especially if the values involved are the result of previous operations that already contain rounding errors. Cancellation is particularly problematic in iterative algorithms, such as solving differential equations or evaluating functions using numerical series, where precision errors can compound over time. To avoid this, algorithms are often rewritten or rearranged to minimise the risk of subtracting similar quantities. Recognising and correcting for cancellation is key to writing stable and accurate numerical software that relies on real number computations.

Hire a tutor

Please fill out the form and we'll find a tutor for you.

1/2
Your details
Alternatively contact us via
WhatsApp, Phone Call, or Email