5 hands-on exercises and 5 find-the-bug challenges for the The Maths You Actually Need lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Find the GCD of forty-eight and eighteen.
Find the LCM of four and six.
List the primes below twelve and join them.
Wrap minus one into the range zero to four.
Report whether two to the sixty is safely representable.
Swapping without taking the remainder makes no progress, so a guard stops it.
Multiplying before dividing can exceed the safe integer range.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceMarking from 2i re-crosses numbers that already have a smaller factor, and here it wrongly clears a prime.
The percent operator keeps the sign, so a negative index stays negative.
MAX_VALUE is far past the safe integer range, so the test always passes.