1 -- decin/decout - Decimal i/o
3 proc decin(chan in, var d, c)=
4 -- Reads a decimal number from input into d. c is used as the first input
5 -- character, and it contains the character just after the decimal number
10 while (c='*s') or (c='*t') or (c='*n')
20 while ('0'<=c) and (c<='9')
28 proc decout(chan out, value d, w)=
29 -- Sends d to channel out in decimal on a field of w spaces. It is just like
30 -- fprintf(out, "%*d", w, d);
32 var dec[BYTE 12], di, dd, d0, neg:
47 dec[BYTE di]:=(dd\10)+'0'