Rev Language Reference


sqrt - Square root of a number

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

Usage

sqrt(RealPos x)

Arguments

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

Return Type

Example

# 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