Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Is there any way to get Turing to calculate and display:
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mark_Tran




PostPosted: Mon Apr 17, 2006 12:45 pm   Post subject: Is there any way to get Turing to calculate and display:

Is there any way to get Turing to calculate and display the first 1000 digits of Pi ? If there is can someone please post the code for it? That would be awesome Razz
Sponsor
Sponsor
Sponsor
sponsor
cool dude




PostPosted: Mon Apr 17, 2006 1:26 pm   Post subject: (No subject)

pi is infinite and turing doesn't have a built in function pi. if u wanted to u could make a constant and write out all the first 1000 numbers that pi has and store it in that constant so then u could just call the constant instead of typing out all those numbers. but i don't think turing can even handle that big of a number
Andy




PostPosted: Mon Apr 17, 2006 1:27 pm   Post subject: (No subject)

the simplest way is to use the Gregory approach.. but that'll take you a very long time to calculate 1000 digits. if all you want to do is to display it, then you can simply read the value off of here
Delos




PostPosted: Mon Apr 17, 2006 4:28 pm   Post subject: (No subject)

cool dude wrote:
pi is infinite and turing doesn't have a built in function pi.


code:

put Math.PI


Goes up to about 48 digits.
[Gandalf]




PostPosted: Mon Apr 17, 2006 4:33 pm   Post subject: (No subject)

Heh, that's an amazing site address.

cool dude wrote:
pi is infinite and turing doesn't have a built in function pi. if u wanted to u could make a constant

Yeah, Turing doesn't have a function for pi, but it does have a constant for it:
code:
put Math.PI
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: