Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

Sqr

Returns the square root of a number.

Synopsis

Sqr(number)

Arguments

The number argument can be any valid numeric expression greater than or equal to 0. You cannot return the square root of a negative number. Attempted to do so results in a runtime error.

Examples

The following example uses the Sqr function to calculate the square roots of the integers 0 through 16:

For x = 0 To 16
Println "Square root of ",x," = ",Sqr(x)
Next
Copy code to clipboard

The following example uses the Sqr function to calculate the square root of pi:

pi = 4 * Atn(1)
Println "Square root of pi = ",Sqr(pi)
Copy code to clipboard

See Also