AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Arithmetic operations in a programming language: real division

    Real division divides one numeric value by another and keeps any fractional part, producing a real (decimal) result.

    Checked against the AQA 8525 specification (opens in a new tab) on .

    • Point 5 of 8

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    Real division divides one numeric value by another and keeps any fractional part, producing a real (decimal) result. In many languages it is written with the forward slash operator, so result ← 7 / 2 stores 3.5 rather than 3. Learners should distinguish real division from integer division, which discards the remainder. They should be able to evaluate a division expression, recognise when the result is real, and explain why dividing by zero is an error that a program must avoid. They should also trace a short program line and state the value assigned, and recognise real division inside a mixed expression where precedence applies.

    What earns the marks

    • Identifies the real division operator in a program line, typically the forward slash symbol.
    • Correctly evaluates a division such as 7 / 2 as 3.5, keeping the fractional part.
    • Distinguishes real division, which keeps the fraction, from integer division, which discards it.
    • Explains that dividing by zero is an error and should be avoided in a program.
    • Traces a short program and states the real value stored in a variable after a division statement.

    Common mistakes and how to put them right

    • Treating 7 / 2 as 3 by discarding the remainder.

      Put it right: Real division keeps the fractional part and gives 3.5.

    • Confusing the forward slash with the integer division operator.

      Put it right: Check which operator the language uses for real division.

    • Ignoring the possibility of division by zero.

      Put it right: Recognise it as an error the program must guard against.

    Exam tips

    • Write the full decimal result, not a rounded integer, when the question asks for real division.
    • State clearly whether an operator performs real or integer division before calculating.
    • Check for a zero divisor and say that the program would fail rather than give a value.

    Try the lesson

    The start of the Arithmetic operations in a programming language: real division lesson, made from checked teaching notes for this specification point.

    Have a go first

    A program runs the statement answer = 9 / 2 using real division. What value is stored in answer?

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Arithmetic operations in a programming language: real division

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge