# To print π, e, root 2 to many digits in many radixes # # a68g -prec 100 digits.a68 # PROC d = (INT n)CHAR: (n<10|"0123456789"[n+1]|"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[n-9]); MODE R = LONG LONG REAL; INT decdigs = 100; #a68g -prec 100# PROC sh = (R nv)VOID: ( FOR r FROM 2 TO 36 DO R n := nv; TO ENTIER (decdigs * log(10)/log(r)) DO R v = n*r; INT e = SHORTEN SHORTEN ENTIER v; n := v-e; print(d(e)) OD; print(newline) OD); sh((4*long long arctan(1))-3); sh((long long exp(1))-2); sh((long long sqrt(2))-1)