Gerson's Pi Program
|
03-03-2022, 03:01 AM
Post: #10
|
|||
|
|||
RE: Gerson's Pi Program
(03-02-2022 11:17 AM)EdS2 Wrote: Hmm, thanks for the suggested edits, but unfortunately something isn't quite right... I have a working version for the BeebEm emulator, but I don't know how to get a listing. Anyway, basically you should delete line 40 and use MOD instead: 520 T=(B-BR%-C(I)) MOD B 890 W(I)=INT(X/G): Y=X MOD G 960 W(I)=X MOD B: Y=INT(X/B) 1030 C(I)=X MOD B: Y=INT(X/B) Also, lines 30, 740 and 740 should be changed to 30 DEF FNFRAC(X) = X+5E-6 - INT(X+5E-6) 740 AC=INT(B*FNFRAC(CT)) 810 C(I)=INT(B*FNFRAC(T)) I've used only real variables, including the one in line 520, but you can change the types of the variables accordingly for speed and memory saving. On the MSX I cannot define AC and C() to integer, because its integer type is only 2-byte long. For the same reason MOD cannot be used on the MSX for bases greater than 10000. For 12 digits you should get 3 1415 9265 3589 8142 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)