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

Username:   Password: 
 RegisterRegister   
 sqrt
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
metachief




PostPosted: Sun Sep 21, 2008 11:34 pm   Post subject: sqrt

How could you take the root that's bigger than 2 of a number in the turing language. For instance how would i type the command in turing for the cubed root of 3, or the quad root of 3?
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Sun Sep 21, 2008 11:58 pm   Post subject: RE:sqrt

Use math:
sqrt(x) = x^(1/2)
So cubed root of x would be:
x^(1/3)
Translate that to Turing:
code:
put sqrt(25)
put 25 ** (1/2)

They should be the same.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: