Sqrt
Returns the square root of a number.
Syntax
Sqrt(Val)
Parameters
Val
Type: Double
A numeric value greater than or equal to zero.
(return)
Type: Double
Square root of Val.
Remarks
The square root is the number that when multiplied by itself gives Val.
An error occurs if Val is negative. If the current data value is NULL, Val is 0.0 and the return value is 0.0.
This function is similar to the Sqr function in VBScript.
Example
The following mrScriptBasic example uses the Sqrt function to return the square root of a number:
Dim MyValue1, MyValue2, MyValue3
MyValue1 = Sqrt(9) ' Returns 3
MyValue2 = Sqrt(3) ' Returns 1.73205080756888
MyValue3 = Sqrt(-3) ' Error
See also