RosettaCodeData/Task/Nth-root/AWK/nth-root-3.awk

9 lines
88 B
Awk

{
x = $0
do {
y = x
x = (x + $0/x)/2
} while (x < y)
print "sqrt(" a ")=" x
}