Hacker News new | ask | show | jobs
by JoeCamel 2654 days ago
I teach people that there are many ways to encode numbers into 0, 1 symbols (state of switches). One obvious way for natural numbers is base-2 (with more significant bits on the left). It get's more complicated with negative numbers (two's complement usually, but could also be one sign bit). Floating point numbers are hard. You could also use variable length integers where small numbers are represented with less bits and you use one bit to mark end of a number (every 8 bits).