6 lines
203 B
Text
6 lines
203 B
Text
func nthroot_fast(n, a, precision=1e-5) {
|
|
{ a = nthroot(2, a, precision) } * int(n-1)
|
|
a ** (2**int(n-1) / n)
|
|
}
|
|
|
|
say nthroot_fast(5, 34, 1e-64) # => 2.02439745849988504251081724554193741911462170107
|