Arithmetic Operations (AQA GCSE Computer Science): Revision Notes
Arithmetic operations
What are arithmetic operations?
Arithmetic operations are the basic mathematical calculations that computers can perform on numbers in your programmes. Think of them as the mathematical tools that allow your programme to do calculations, just like you would with a calculator. These operations form the foundation of most computer programmes, from simple calculators to complex games and applications.
When you write a programme, you'll use special symbols called operators to tell the computer what mathematical operation you want it to perform. Each operator has a specific job and follows particular rules about how it works.
Operators in programming are like mathematical symbols - they tell the computer exactly what calculation to perform. Understanding these operators is essential for writing effective programmes.
Basic arithmetic operators
Let's start with the four arithmetic operators you're probably already familiar from maths class:

Addition (+) combines two numbers together. For example, if you want to add the values stored in variables b and c, you would write something like a ← b + c. This tells the computer to take the value in b, add the value in c to it, and store the result in variable a.
Subtraction (-) takes one number away from another. The operation x ← y - 1 would take the value stored in y, subtract 1 from it, and put the result into variable x. Remember that the order matters here - you're subtracting the second value from the first.
Multiplication (*) multiplies two numbers together. Most programming languages use the asterisk (*) symbol instead of the × symbol you might be used to from maths. So score ← score * 10 would multiply the current value of score by 10.
The asterisk (*) symbol is used for multiplication in most programming languages because the × symbol isn't available on standard keyboards and could be confused with the letter 'x'.
Division (/) divides one number by another. The operation value ← num1 / num2 divides the first number by the second. However, division can be tricky in programming because there are actually two different types!
Special division operators
Programming languages have two special types of division that you need to understand:
Understanding MOD and DIV is crucial for programming. These operators work differently from regular division and are used frequently in algorithms and problem-solving.
MOD (Modulus) is a special operator that gives you the remainder when you divide one number by another. For example, if you calculate , you get 1 because when you divide 5 by 2, you get 2 with a remainder of 1. This operator is incredibly useful for checking if numbers are even or odd, or for creating repeating patterns in your programmes.
DIV (Integer Division) gives you only the whole number part of a division, completely ignoring any remainder. So would give you 2, because 5 divided by 2 is 2.5, but we only want the whole number part (2).
Worked Example: Understanding MOD and DIV
Let's calculate and :
Step 1: Divide 17 by 5 remainder
Step 2: Apply the operators
- (the remainder)
- (the whole number part)
These special division operators are particularly helpful when you need to work with whole numbers only, or when you want to find patterns in data.
Understanding operator precedence
When your programme encounters a mathematical expression with multiple operations, it needs to know which operation to do first. This is where operator precedence comes in - it's like the order of operations you learned in maths.
Operator precedence determines the order in which operations are performed. Getting this wrong will cause your programmes to calculate incorrect results!
The rule to remember is BIDMAS:
- Brackets (do anything in brackets first)
- Indices (powers and roots)
- Division and Multiplication (from left to right)
- Addition and Subtraction (from left to right)
Worked Example: Applying BIDMAS
Let's calculate
Step 1: First, do the brackets:
Step 2: Then multiplication:
Step 3: Finally addition:
If we ignored the rules and just worked left to right, we'd get: ❌
The correct answer following BIDMAS is 23.
Practical uses of MOD
The MOD operator deserves special attention because it's so useful in programming. Here are some common ways you'll use it:
Checking if a number is even or odd: Any number MOD 2 will give you 0 if the number is even, or 1 if it's odd. This is because even numbers divide perfectly by 2 (no remainder), while odd numbers always leave a remainder of 1.
Creating cycles: If you want something to repeat every few steps, MOD is perfect. For example, in a game where you want an enemy to change direction every 4 moves, you could use the move counter MOD 4.
Checking multiples: To see if one number is an exact multiple of another, use MOD. If the result is 0, then it's an exact multiple.
Worked Example: Practical MOD Applications
Checking if 18 is even: ✓ (Even number)
Creating a 3-step cycle for position 7: (This tells us we're at step 1 of the cycle)
Checking if 15 is a multiple of 5: ✓ (Yes, 15 is exactly divisible by 5)
Introduction to relational operations
While arithmetic operations perform calculations, relational operations (also called comparison operations) compare values and give you a simple True or False answer. These are essential for making decisions in your programmes.

Equal to (=) checks if two values are exactly the same. For example, is True, but is False. In some programming languages like Python, you might see this written as == instead.
Not equal to (≠) checks if two values are different. So is True (because 7 and 9 are different), but is False (because both sides equal 3). Different programming languages might write this as <> or !=.
Less than (<) checks if the first value is smaller than the second. For example, is True, but is False (because 4 is not less than itself - they're equal).
Relational operators always return Boolean values - either True or False. This makes them perfect for creating conditions in your programmes that help make decisions based on data.
These comparison operations are the building blocks for creating programmes that can make decisions and respond differently based on the data they're working with.
Key Points to Remember:
- Arithmetic operators (+, -, *, /, MOD, DIV) perform mathematical calculations on numbers in your programmes
- MOD gives you the remainder from division and is great for checking if numbers are even/odd or creating repeating patterns
- DIV gives you the whole number part of division, ignoring any remainder
- BIDMAS rules apply - always do brackets first, then indices, then division/multiplication, then addition/subtraction
- Relational operators (=, ≠, <) compare values and return either True or False, helping your programmes make decisions