Jump to content

Recommended Posts

Posted (edited)

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

  Quote

So far we know 1.7 trillion digits

Edited by au3scr
Posted (edited)

@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
Posted

  au3scr said:

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?

Posted

@au3scr

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

Cheers, FireFox.

Posted (edited)

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
Posted

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

I wanna make program that calculates all number.

Posted (edited)

  au3scr said:

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
Posted (edited)

@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
Posted (edited)

  au3scr said:

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...