Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
12
Task/Nth-root/Ring/nth-root.ring
Normal file
12
Task/Nth-root/Ring/nth-root.ring
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
decimals(12)
|
||||
see "cube root of 5 is : " + root(3, 5, 0) + nl
|
||||
|
||||
func root n, a, d
|
||||
y = 0 x = a / n
|
||||
while fabs (x - y) > d
|
||||
y = ((n - 1)*x + a/pow(x,(n-1))) / n
|
||||
temp = x
|
||||
x = y
|
||||
y = temp
|
||||
end
|
||||
return x
|
||||
Loading…
Add table
Add a link
Reference in a new issue