[math-fun] digits of e, one at the time,
Hello, speaking of a short program, here is one from 1990 I worked on : at the time I was a BASIC fan, the compiler I had was Zbasic, a fantastic engine on a mac, capable of computing digits up to 54 digits! and compiled, very fast. that simple routine, now called a spigot algorithm can extract digits of exp(1) one column at the time but of course, the program takes memory, 5 years later this is where I could do it for Pi but in base 2, or in base 10 but very slowly. program 'decde' digits of e, August 5 1990. DEFDBL INT A-Z 'OPEN"O",1,"essai" B=10000 D=0 DIM R(10000) S=0:A=B DO N=1 DO Q=A/N R(N)=A MOD N S=S+Q A=R(N+1)*B+Q N=N+1 UNTIL A=0 AND R(N+1)=0 D=D+1 PRINT D*4; S=0 IF INKEY$="s" THEN STOP UNTIL N>9900 STOP best regards and have a nice day. Simon Plouffe
participants (1)
-
Simon Plouffe