Unix/Linux Go Back    


What is on Your Mind? Come inside and relax a while. Discuss whatever is on your mind. New members can introduce themselves. However, technical Q&A should happen in our other forums.

PI calculated by hand. If this doesn't blow your mind nothing will.

What is on Your Mind?


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wisecracker
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 April 2018, 8:12 AM EDT
Location: Loughborough
Posts: 1,256
Thanks: 375
Thanked 336 Times in 263 Posts
PI calculated by hand. If this doesn't blow your mind nothing will.

This came to my attention very recently...
I have put it here as a fun item not related to UNIX in any way...

Chudnovsky algorithm - Wikipedia

WOW!
And a great, light hearted 16 minute video about it:

Calculating π by hand: the Chudnovsky algorithm - YouTube

Enjoy...

Last edited by wisecracker; 4 Weeks Ago at 02:57 PM.. Reason: No change except PT should read PI and I dunno how to edit it...
The Following User Says Thank You to wisecracker For This Useful Post:
jim mcnamara (4 Weeks Ago)
Sponsored Links
    #2  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wisecracker
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 18 April 2018, 11:39 PM EDT
Location: NM
Posts: 11,348
Thanks: 602
Thanked 1,151 Times in 1,060 Posts
Fixed the title. Nice topic!
Sponsored Links
    #3  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wisecracker
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 19 April 2018, 5:49 AM EDT
Location: Aachen, Germany
Posts: 12,487
Thanks: 400
Thanked 3,867 Times in 3,556 Posts
I most like the d = −163 assumption - the rest is beyond me, I'm afraid.
    #4  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wisecracker
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 17 April 2018, 8:12 AM EDT
Location: Loughborough
Posts: 1,256
Thanks: 375
Thanked 336 Times in 263 Posts
Hi...
(Apologies for any typos.)
I decided to try the Python code supplied in the wiki URL...
No alteration to the code, Python 2.7.10 - OSX default, and Python 3.5.2 on the same machine, both are old.
OSX 10.13.3, default bash terminal:


Code:
Last login: Mon Mar 19 13:26:13 on ttys000
AMIGA:amiga~> cd Desktop/Code/Python
AMIGA:amiga~/Desktop/Code/Python> python2.7 chudnovsky_pi.py
PI(maxK=70 iterations, gc().prec=1008, disp=80 digits) =
3.141592653589793238462643383279502884197169399375105820974944592307816406286208

For greater precision and more digits (takes a few extra seconds) - Try
Pi = PI(317,4501,4500)
Pi = PI(353,5022,5020)
AMIGA:amiga~/Desktop/Code/Python> python3.5 chudnovsky_pi.py
PI(maxK=70 iterations, gc().prec=1008, disp=80 digits) =
3.141592653589793238462643383279502884197169399375105820974944592307816406816734

For greater precision and more digits (takes a few extra seconds) - Try
Pi = PI(317,4501,4500)
Pi = PI(353,5022,5020)
AMIGA:amiga~/Desktop/Code/Python> _

Note the last 6 digits!
I have no idea why they should be different.
Is this a bug or just a limitation of version 2.7.x, assuming 3.5.x is correct?
Although I think Python 2.7.x is being dropped in 2020 so subtleties like this are being ignored?
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Merge left hand strings mapping to different right hand strings gimley Shell Programming and Scripting 3 08-20-2013 12:17 AM
awk calculated with amazing result saloman UNIX for Advanced & Expert Users 0 02-10-2012 07:41 AM
awk calculated with amazing result saloman UNIX for Dummies Questions & Answers 0 02-10-2012 07:36 AM
adding calculated column shantanuo Shell Programming and Scripting 7 03-19-2009 07:17 AM



All times are GMT -4. The time now is 05:51 AM.