Function Sqrt() Foundation
Calculates square root of a positive number.
Syntax
Sqrt( <nValue> ) --> nSquareRoot
Parameters
<nValue>
<nValue> is a positive numeric expression whose square root is calculated.
Return
Sqrt() returns the square root as a numeric value. The number of decimal places displayed in the result depends only on the setting SET DECIMALS and not on SET FIXED. When the value of <nValue> is negative, zero is returned.
Description
Sqrt() is a mathematical function used in numeric calculation to determine the square root (for example in statistical evaluations calculating variances and standard deviations).
Examples
// The example shows various results of the function Sqrt()
PROCEDURE Main
SET FIXED OFF
? Sqrt( 2 ) // result: 1.41
? Sqrt( 10 ) // result: 3.16
? Sqrt( 100 ) // result: 10.00
? Sqrt( 1000 ) // result: 31.62
? Sqrt( 10000 ) // result: 100.00
SET DECIMALS TO 6
? Sqrt( 2 ) // result: 1.414214
? Sqrt( 10 ) // result: 3.162278
? Sqrt( 100 ) // result: 10.000000
? Sqrt( 1000 ) // result: 31.622777
? Sqrt( 10000 ) // result: 100.000000
RETURN
Feedback
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.