Computer Science Canada i need help with square roots |
Author: | mattsyv [ Thu Jan 26, 2006 1:08 pm ] | ||
Post subject: | i need help with square roots | ||
ok i have this loop i dont no how to square it can u plz help me [/code] var product : int product := 1 for countLoop : 1 .. 5 product := product * sqrt put countLoop, "...", product put "" end for
|
Author: | do_pete [ Thu Jan 26, 2006 1:28 pm ] | ||||||
Post subject: | |||||||
If you want to square a number you would go like this
If you want the square root you would go:
or
|
Author: | blaster009 [ Thu Jan 26, 2006 8:12 pm ] | ||
Post subject: | |||
And if you need to go further (cubic roots, quartic roots etc), just multiply by the equivalent fraction.
Etc... |