1 | Assert(Base != 0); |
However, if Base is 1 then the loop never stops since dividing by 1 doesn't do anything. The assert should probably be changed to something like the following.
1 | Assert(Base > 1); |
Side note, just after adding that assert, Casey wondered aloud whether there was such a thing as base zero. As far as I know there is not, but surprisingly negative bases are a thing! Some early Polish computers even used negabinary (base -2).