minor bug/issue Day 328: Overly narrow assert in U64ToASCII
2 years, 5 months ago Edited by Ryan1729 on Jan. 18, 2017, 5:46 a.m. Reason: correct country
Right here on day 328 Casey implemented the U64ToASCII function as part of the printf replacement, and added the following assert to catch the case where there would be a divide by zero error since the loop in that function advances by diving Value by Base while Value != 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.
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).