Binary calculator
Arithmetic on whole numbers of any size, shown in binary, octal, decimal and hexadecimal at once. The sum is done once and exactly; the bases are only four ways of writing the same answer down. Nothing you type here leaves your browser — it is worked out on your own device, so there is nothing to send and nothing to log.
What integer division actually does
Dividing whole numbers has to decide what to do with
the part that is left over, and there is more than one defensible
answer. This page truncates towards zero, which is what
a processor's integer divide does and what C, Java and JavaScript's
BigInt all do: −7 divided by 3 is −2, and the
remainder is −1.
Python does it differently. It floors, so −7 // 3 is −3 and −7 % 3 is 2 — a positive remainder. Neither is wrong; they are two conventions, and code that assumes one while running on the other produces answers that are off by one only for negative numbers, which is the hardest kind of bug to notice. The working below gives both.
The remainder is shown with every division rather than discarded, because an integer division that throws it away has answered half the question.