Skip to main content

squareRoot

squareRoot ( number : number) : number

ParameterTypeDescription
numbernumber->Number whose square root is calculated
Resultnumber<-Square root of the number

Description

squareRoot returns the square root of number.

Example 1

The following example assigns the value 1.414213562373 to the variable vrSquareRootOfTwo.

 var vrSquareRootOfTwo : number
vrSquareRootOfTwo = squareRoot(2)

Example 2

The following method returns the hypotenuse of the right triangle whose two legs are passed as parameters:

 declare ( legA : number , legB : number) -> hypothenuse : number
hypothenuse: = squareRoot((legA^2)+(legB^2))