A Clock (Modular) Arithmetic Renaming Calculator

Here is a calculator for finding different "names" of a whole number on a clock with a given number of hours. (In mathematical terminology, it finds congruent integers for a given modulus.) If this doesn't make any sense to you, here's an explanation of what clock arithmetic is, with an interactive clock that shows the different names for a number on a clock in another way.

If you don't have a java-enabled browser, you won't be able to see this applet.

Instructions

1. Type the number you want another name for in the first box.
2. Type the number of hours on the clock you want to use in the second box (after "mod").
3. Click the "=" button to get the smallest nonnegative "name" for the first number on the clock.
4. If you want a bigger name, click the "up" button. If you want a smaller name, click the "down" button.

Problems? Got an "E"?

• All numbers must be whole numbers. The first number can be positive, negative, or 0.
• The number of hours on the clock (modulus) must be a whole number at least 2.
• If you type in a number bigger than the box, it will turn to an "E" (for Error) because thill turn to an "E" (for Error) because this computer program can't handle numbers above a certain size.
• You have to click "=" or hit the return key after typing for the program to calculate anything.