I am trying to make a program that will read in a number, and then output each digit of that number in the list. However, most things look great until I try with numbers 8 and 9. The program displays \b \t.
if the input number contains 8 or 9, and at the same time there are other numbers, for example 283, it will print normally. Otherwise, if there is only 8 or 9, for example 8, 99then this will give me this binary representation of 8 and 9 (if I remember correctly).
My program is as follows:
digitize(0)-> 0;
digitize(N) when N < 10 -> [N];
digitize(N) when N >= 10 -> digitize(N div 10)++[N rem 10].
maoyi source
share