Comment

Comment by vog

Why do people invent these strange terms?

"wraparound arithmetic". "unchecked arithmetics". Really?

The correct term is modular arithmetic, which is well established in maths for centuries. And it is properly backed by a really nice and almost dead-simple theory (at least from a programmer's point of view). Is this no longer taught in school?

If you like to emphasize the fact that it's mostly modulo a power of two (2^n), then call it two's complement. However, that overemphasizes the binary representation, which I find most of the time more distracting than helpful.

As a side note, integer division is usually not performed in modular arithmetics, but addition, subtraction and multiplication are.

parent vog 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton