RosettaCodeData/Task/Nth-root/S-BASIC/nth-root-1.basic
2023-07-01 13:44:08 -04:00

15 lines
364 B
Text

rem - return nth root of x
function nthroot(x, n = real) = real
end = exp((1.0 / n) * log(x))
rem - exercise the routine by finding successive roots of 144
var i = integer
print "Finding the nth root of x"
print " x n root"
print "-----------------------"
for i = 1 to 8
print using "### #### ###.####"; 144; i; nthroot(144, i)
next i
end