Source: http://math.univ-angers.fr/~labatte/l3sen/Cours/TD_NUMeRATION.pdf