## Happy pi day - March 14th

Discussion about ZX80 / ZX81 Software
ZX79
Posts: 5
Joined: Wed Apr 06, 2016 9:36 pm

### Happy pi day - March 14th

It was reported today that the record for pi is 31 trillion digits.

I don't know if this has been established already, if not, as a pi day challenge:

What is the most accurate approximation of pi that can be calculated using either the expanded or unexpanded ZX80?

Here are some suggestions for calculating pi:

https://en.wikipedia.org/wiki/Approximations_of_π
www.mathworld.wolfram.com/PiApproximations.html

Note, 10 PRINT "3.141592653589793" or similar, does not count.

GCHarder
Posts: 242
Joined: Sat Dec 14, 2013 7:46 pm

### A Program to Calculate Pi

The author claims over 8000 decimal places in 16K. Presumably more with extended RAM.

Regards;

Greg
Attachments
Pi.gif (6.55 KiB) Viewed 1592 times
Pi (Syntax v5n01).zip

Moggy
Posts: 1874
Joined: Wed Jun 18, 2008 2:00 pm

### Re: Happy pi day - March 14th

Very late in the day I know but somehow I missed this.

The author of this program also published it in Sync magazine minus the any key to continue thing but although the code looks the same it doesn't work very well. by that I mean every odd iteration the answer is miles out with PI starting as 3.14159... first time around then 3.175065.....then occasionally giving a correct result.

Is it possible any of our programming gurus could put me out of my misery because apart from the 2 different display methods it all looks the same to me?

The attached P file PI2 is the version published in Sync Vol 3 number 6 and P1 is the version kindly supplied by Greg.
Attachments
pi2.p
Pi.p

olofsen
Posts: 169
Joined: Wed Jan 08, 2014 12:29 pm

### Re: Happy pi day - March 14th

Changing line 220 in pi2.p to the one in pi.p seems to help - so

Code: Select all

``````220 LET S=-1
``````

Moggy
Posts: 1874
Joined: Wed Jun 18, 2008 2:00 pm

### Re: Happy pi day - March 14th

Many many thanks for this Erik.

Just 1 character incorrect causes such error! It is very pleasing that there's always someone who will help those such as myself who are not so smart, I really do love this community and have learned so much from it.

Thanks again, Erik.

Fred.

stefano
Posts: 407
Joined: Tue Dec 11, 2012 9:24 am
Contact: