User blog comment:Deedlit11/Bignum Bakeoff appetizer/@comment-5529393-20140916022609/@comment-24061664-20140916101955

Therefore, after while (i++, o * b <= n) o *= b; i--; might be required.