GCSE · Computer Science · AQA · Spec 8525
Real division
Share 7 pizzas between 2 people and each gets three and a half, not three. A program doing real division agrees: 7 / 2 is 3.5.
Computer Science · Programming
Real division inside a program
This program averages four test marks. Step through it and keep an eye on the Variables panel.
Stop when line 6 lights up and total holds 29. Before you press Next, predict: will average hold 7, or something else?
1 score1 ← 72 score2 ← 83 score3 ← 64 score4 ← 85 count ← 46 total ← score1 + score2 + score3 + score47 average ← total / count8 OUTPUT average
Variables
Output
Step 1: score1 stores 7.
Use Next to go one line at a time and watch the Variables panel update.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
7 / 2 is 3.5, not 3 — real division keeps the whole answer, fractional part and all.
What you need to know
- Real division divides one number by another and gives the full answer, keeping any fractional part (the part after the decimal point).
- In the pseudo-code in this lesson, real division is written with /, for example average ← total / count.
- Dividing two whole numbers can give an answer that isn't whole: 7 / 2 = 3.5 and 3 / 4 = 0.75.
- When a division comes out exactly, the answer is a whole number: 10 / 5 = 2.
- Order matters: bill / people shares the bill between the people, but people / bill gives a completely different value.
The big picture
Real division divides one number by another and keeps the full answer, including any part after the decimal point: 7 / 2 gives 3.5, not 3. In a program you write it with /, store the result in a variable, and can predict that value before the program runs.
Key points
Worked example
Problem
A program stores distance ← 45 and laps ← 6, then runs lapLength ← distance / laps. What value does lapLength store?
⚠ Watch out
Chopping the answer down to a whole number, for example writing 29 / 4 as 7 instead of 7.25. Real division keeps the fractional part. Giving only the whole-number part is a separate operation (integer division), so don't mix the two up.
Memory hook
Nothing gets chopped: 7 / 2 lands at 3.5, between the tick marks, not on the 3.
Check yourself
No calculator: what does x store after x ← 11 / 4? Work out how many whole times 4 goes in, then what the leftover is worth.
Flashcards
(7)What does real division do?
What symbol does this lesson's pseudo-code use for real division?
Can dividing two whole numbers give an answer that isn't whole?
When does real division give a whole-number answer?
total ← 17 and count ← 2. What does total / count give?
What is the difference between bill / people and people / bill?
Does every programming language treat / as real division?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 30 September 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.