The simple math behind decimal-binary conversion algorithms