Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Nth-root/Arturo/nth-root.arturo
Normal file
14
Task/Nth-root/Arturo/nth-root.arturo
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
nthRoot: function [a,n][
|
||||
N: to :floating n
|
||||
result: a
|
||||
x: a / N
|
||||
while [0.000000000000001 < abs result-x][
|
||||
x: result
|
||||
result: (1//n) * add (n-1)*x a/pow x n-1
|
||||
]
|
||||
return result
|
||||
]
|
||||
|
||||
print nthRoot 34.0 5
|
||||
print nthRoot 42.0 10
|
||||
print nthRoot 5.0 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue