posted 3y ago by Peter Taylor
The formal formula for base conversion of a non-negative number is $$x = \left\lfloor \frac{x}{b} \right\rfloor b + (x \bmod b)$$ For binary, $b=2$.