The purpose of this page is to help you understand how computers do math. These exercises are not meant to help you understand math better, it is to teach you how to tell computer to do math for you.

Division and Mod

While you're probably already comfortable with division, this might be your first encounter with the modulo operation. The modulo operation is used to find the remainder after division. In JavaScript the modulo operator is denoted with a percent sign %.

A quick example - dividing 10 by 6:

Division

  1. How to turn 16849 into 168
  2. How to turn 16849 into 1684
  3. How to turn 248 into 24
  4. How to turn 168 into 16

Mod

  1. How to get 49 from 25249
  2. How to get 249 from 25249

Exercises

  1. How to get 24 from 25249
  2. How to get 52 from 25249