Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Nth-root/11l/nth-root.11l
Normal file
11
Task/Nth-root/11l/nth-root.11l
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
F nthroot(a, n)
|
||||
V result = a
|
||||
V x = a / n
|
||||
L abs(result - x) > 10e-15
|
||||
x = result
|
||||
result = (1.0 / n) * (((n - 1) * x) + (a / pow(x, n - 1)))
|
||||
R 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