Happy pi day - March 14th

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

Happy pi day - March 14th

Post by ZX79 » Thu Mar 14, 2019 7:21 pm

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. :-)

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

A Program to Calculate Pi

Post by GCHarder » Tue Apr 16, 2019 10:26 pm

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

Regards;

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

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

Re: Happy pi day - March 14th

Post by Moggy » Tue Jul 16, 2019 6:36 pm

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
(2.73 KiB) Downloaded 44 times
Pi.p
(2.41 KiB) Downloaded 42 times

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

Re: Happy pi day - March 14th

Post by olofsen » Wed Jul 17, 2019 8:02 am

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

Post by Moggy » Wed Jul 17, 2019 2:46 pm

Many many thanks for this Erik. :D

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.

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

Re: Happy pi day - March 14th

Post by stefano » Tue Oct 15, 2019 5:28 pm

Very late.. but this article must be in the loop:

https://github.com/z88dk/z88dk/wiki/pi

Post Reply