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

Username:   Password: 
 RegisterRegister   
 How do you do square roots on turing? Im new so...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
UraniumLobster




PostPosted: Wed Sep 12, 2007 9:31 am   Post subject: How do you do square roots on turing? Im new so...

Just wanted to know how you use square roots/cube roots in turing. I have to make a calculator which is simple I just don't know/remember how to square root a number. I haven't programmed in over 3 years, and it has slipped my mind...
Sponsor
Sponsor
Sponsor
sponsor
rdrake




PostPosted: Wed Sep 12, 2007 10:16 am   Post subject: RE:How do you do square roots on turing? Im new so...

If I recall correctly, you might want to check out something along the lines of sqrt(). Also remember F10 is your friend.
Tony




PostPosted: Wed Sep 12, 2007 11:19 am   Post subject: RE:How do you do square roots on turing? Im new so...

You could just use exponents

sqrt(x) = x**0.5
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Clayton




PostPosted: Wed Sep 12, 2007 3:45 pm   Post subject: RE:How do you do square roots on turing? Im new so...

Yes. Remember that x^1/n is the nth root of that number. So 8^1/3 will give you 2 (the cube root of 8) Smile
Mazer




PostPosted: Wed Sep 12, 2007 5:48 pm   Post subject: Re: RE:How do you do square roots on turing? Im new so...

rdrake @ Wed Sep 12, 2007 10:16 am wrote:
If I recall correctly, you might want to check out something along the lines of sqrt(). Also remember F10 is your friend.

And on that note, so is F9 unless they changed something.
Clayton




PostPosted: Wed Sep 12, 2007 7:19 pm   Post subject: RE:How do you do square roots on turing? Im new so...

F9 will give you the page for the keyword your cursor is blinking on, F10 will just open up the help manual.
Dabond




PostPosted: Wed Oct 17, 2007 10:21 am   Post subject: Re: How do you do square roots on turing? Im new so...

"number"**"exponent"
Zampano




PostPosted: Wed Oct 17, 2007 10:25 am   Post subject: Re: How do you do square roots on turing? Im new so...

On a related note, isn't it messed up that the squared number is inside the brackets uinstead of the number the be squared. It took me a long time to understand that.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Wed Oct 17, 2007 1:05 pm   Post subject: RE:How do you do square roots on turing? Im new so...

Uh, Zampano, the square root function takes a number x and returns the number that, when squared, gives x. You might say sqrt(x^2) = x (ie. sqrt and f(x) = x^2 are inverse functions when defined on the positive reals). So it does make sense that the squared number is the parameter to sqrt.
Follow?
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  [ 9 Posts ]
Jump to:   


Style:  
Search: