const func float: nthRoot (in integer: n, in float: a) is func result var float: x1 is 0.0; local var float: x0 is 0.0; begin x0 := a; x1 := a / flt(n); while abs(x1 - x0) >= abs(x0 * 1.0E-9) do x0 := x1; x1 := (flt(pred(n)) * x0 + a / x0 ** pred(n)) / flt(n); end while; end func;