Task

Implement the algorithm to compute the principal   nth   root   





A

n





{\displaystyle {\sqrt[{n}]{A}}}

   of a positive real number   A,   as explained at the   Wikipedia page.



func power x n . r .
  r = 1
  for i range n
    r *= x
  .
.
func 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 0 4
print r