Gerson's Pi Program
|
03-01-2022, 11:41 AM
(This post was last modified: 03-01-2022 04:12 PM by Gerson W. Barbosa.)
Post: #8
|
|||
|
|||
RE: Gerson's Pi Program
(03-01-2022 09:39 AM)EdS2 Wrote: Very nice! I'd like to port it to BBC Basic, where we have 4 byte integers and 5 byte floats. But it's not working... any ideas? B stands for base. Default variable types in MSX are double precision (8 bytes, 14 significant digits), which allows for bases as high as 10000000. With 9-digit precision, you should choose base = 10000 or perhaps 100000. The \ operator is the integer division, as you have correctly guessed. The exclamation sign says it's a single precision number. Try changing lines 80 and 440: 80 B = 10000: N=ND DIV 4 + 2: K=ND*12 DIV 25 + 1 440 M=10*LOG(ND)/LOG(1000) For 30 digits the output should be 3 1415 9265 3589 7932 3846 2643 3832 7941 P.S.: For a much faster program, you might want to try Katie Wasserman's program for the HP-71B: CALCULATING MANY DIGITS OF PI |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)