👤
Home Man
Search
Today's Posts
Register

Discuss whatever is on your mind. New members can introduce themselves. Talk or comment about any topic that's on your mind..

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

👤 Login to reply

 
Thread Tools Search this Thread
# 1  
Old 03-18-2018
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; 03-18-2018 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 (03-18-2018)
# 2  
Old 03-18-2018
Fixed the title. Nice topic!
# 3  
Old 03-18-2018
I most like the d = −163 assumption - the rest is beyond me, I'm afraid.
# 4  
Old 03-19-2018
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?
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to send mail at specific calculated time interval? nalu Shell Programming and Scripting 8 06-05-2017 07:58 AM
Something in my mind - what's your opinion ? Akshay Hegde What is on Your Mind? 4 12-28-2013 01:42 PM
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
AWK Duplicate lines multiple times based on a calculated value jamesfx Shell Programming and Scripting 2 06-28-2011 08:18 AM
adding calculated column shantanuo Shell Programming and Scripting 7 03-19-2009 07:17 AM
Create a calculated field from existing fields atchleykl UNIX for Dummies Questions & Answers 1 04-19-2007 11:13 AM


All times are GMT -4. The time now is 08:43 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password