Jump to content
Sign in to follow this  
au3scr

how to calculate full Pi?

Recommended Posts

au3scr

Here I tried to calculate pi , but I couldn't get 100 decimal places.This script calculates.

How could I do it?

$val = Round( 768 * Sqrt(2 - Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + 1))))))))),100)
MsgBox (1,"Pi value",$val)

at last i want result like this: 3.14159265358979323846264338327950288419716939937510

quote from other site

So far we know 1.7 trillion digits

Edited by au3scr

Share this post


Link to post
Share on other sites
FireFox

@au3scr

Like you say its impossible to calculate pi... :)

search on google 100first decimales and write it as a string ($pi = 3.14159....)

Edit : I dont think if we know how to calculate pi ... its just a number given :o

Cheers, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Josbe

Here I tried to calculate pi , but I couldn't get 100 decimal places.This script calculates.

How could I do it?

$val = Round( 768 * Sqrt(2 - Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + Sqrt(2 + 1))))))))),100)
MsgBox (1,"Pi value",$val)

at last i want result like this: 3.14159265358979323846264338327950288419716939937510

quote from other site

Remember the 15-digit precision.

*me thinking: Rather than calculated, why not use it simply as a constant?

Share this post


Link to post
Share on other sites
FireFox

@au3scr

no... its not precise at all like your tip : 100 decimal or more or like your calc for school :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
cowmoo

Not sure how many decimals this is...but:

Global Const $PI = 3.1415926535897932384626433832795028841971693993751058209749 & _
   445923078164062862089986280348253421170679821480865132823066470938 & _
   446095505822317253594081284811174502841027019385211055596446229489 & _
   549303819644288109756659334461284756482337867831652712019091456485 & _
   669234603486104543266482133936072602491412737245870066063155881748 & _
   815209209628292540917153643678925903600113305305488204665213841469 & _
   519415116094330572703657595919530921861173819326117931051185480744 & _
   623799627495673518857527248912279381830119491298336733624406566430 & _
   860213949463952247371907021798609437027705392171762931767523846748 & _
   184676694051320005681271452635608277857713427577896091736371787214 & _
   684409012249534301465495853710507922796892589235420199561121290219 & _
   608640344181598136297747713099605187072113499999983729780499510597 & _
   317328160963185950244594553469083026425223082533446850352619311881 & _
   710100031378387528865875332083814206171776691473035982534904287554 & _
   687311595628638823537875937519577818577805321712268066130019278766 & _
   111959092164201989938095257201065485863278865936153381827968230301 & _
   952035301852968995773622599413891249721775283479131515574857242454 & _
   150695950829533116861727855889075098381754637464939319255060400927 & _
   701671139009848824012858361603563707660104710181942955596198946767 & _
   837449448255379774726847104047534646208046684259069491293313677028 & _
   989152104752162056966024058038150193511253382430035587640247496473 & _
   263914199272604269922796782354781636009341721641219924586315030286 & _
   182974555706749838505494588586926995690927210797509302955321165344 & _
   987202755960236480665499119881834797753566369807426542527862551818 & _
   417574672890977772793800081647060016145249192173217214772350141441 & _
   973568548161361157352552133475741849468438523323907394143334547762 & _
   416862518983569485562099219222184272550254256887671790494601653466 & _
   804988627232791786085784383827967976681454100953883786360950680064 & _
   225125205117392984896084128488626945604241965285022210661186306744 & _
   278622039194945047123713786960956364371917287467764657573962413890 & _
   865832645995813390478027590099465764078951269468398352595709825822

I'm pretty sure its around 2000.

Edited by cowmoo

Share this post


Link to post
Share on other sites
FireFox

@comwoo

Im sure with you we can have atomic precision :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
au3scr

cowmoo how did you get that? u calculated or found from internet?

I wanna make program that calculates all number.


Share this post


Link to post
Share on other sites
cowmoo

cowmoo how did you get that? u calculated or found from internet?

I wanna make program that calculates all number.

Do you seriously want to calculate over 1.7 Trillion numbers?

I found a script that used that a while back and brought it here.

Edited by cowmoo

Share this post


Link to post
Share on other sites
Josbe

cowmoo how did you get that? u calculated or found from internet?

I wanna make program that calculates all number.

What? All numbers? :)

Supercomputer Hitachi needed about 500hrs for calculate 1,241,100,000,000 decimal digits.

Share this post


Link to post
Share on other sites
FireFox

@Josbe

your link about autoitv3 limits is very interessant... :D

Is these limit has been calculate or you've tested it :)

I can try to beat some records :o

Cheers, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
au3scr

oh I'd better cancel. I didn't even thought tha it would take so long time.


Share this post


Link to post
Share on other sites
Achilles

oh I'd better cancel. I didn't even thought tha it would take so long time.

Just so you know, Pi is an irrational number... If you have any idea what that means you'll know that it doesn't end and that there is no known pattern to how the digits repeat. That means you can't calculate ALL the digits of pi.

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites
PsaltyDS

cowmoo how did you get that? u calculated or found from internet?

I wanna make program that calculates all number.

You are right, pi can be calculated.* This has been discussed before, in many places.

To go beyond 16 decimal places, you will have to abandon AutoIt's standard number types and start parsing long strings instead, the formula will involve some calculus, and you will find AutoIt terribly slow for this kind of work.

To get Pi at the available precision in AutoIt's number formats:

$Pi = 4 * ATan(1)

:)

*Edit: To an arbitrarily large number of digits (i.e to 100 places). It is an irrational number and cannot be precisely enumerated, of course.

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×