Rev Language Reference

sqrt - Square root of a number

Takes the square root of some positive number `x`.


sqrt(RealPos x)


x : RealPos (pass by const reference)
A number.

Return Type


# compute the square root of a real number
x <- 3.0
root <- sqrt(x)
if ( abs(root*root - x) > 1.0e-15) {
    print("Problem computing the square root.")
} else {
    print("Correct computation of the square root.")

See Also