Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Nth-root/EasyLang/nth-root.easy
Normal file
19
Task/Nth-root/EasyLang/nth-root.easy
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
proc power x n . r .
|
||||
r = 1
|
||||
for i = 1 to n
|
||||
r *= x
|
||||
.
|
||||
.
|
||||
proc nth_root x n . r .
|
||||
r = 2
|
||||
repeat
|
||||
call power r n - 1 p
|
||||
d = (x / p - r) / n
|
||||
r += d
|
||||
until abs d < 0.0001
|
||||
.
|
||||
.
|
||||
call power 3.1416 10 x
|
||||
call nth_root x 10 r
|
||||
numfmt 4 0
|
||||
print r
|
||||
Loading…
Add table
Add a link
Reference in a new issue