function sqroot(n)
if n > 0 then
return math.sqrt(n)
else
return "cant compute"
end
end
function pi()
return 3.141592653589793238462643
end
function power(x, y)
if x > 0 and y > 0 then
return math.pow(x, y)
else
return "cant compute"
end
end
function abs(n)
if n >= 0 then
return n
end
if n <= 0 then
return n - (n*2)
end
end
print(abs(-5))
To embed this project on your website, copy the following code and paste it into your website's HTML: