Click or drag to resize

SQrt Function

Return the square root of a positive number.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.08
Syntax
 FUNCTION SQrt(
	nNumber AS USUAL
) AS FLOAT
View Source

Parameters

nNumber
Type: Usual
A positive number to take the square root of.  A negative <nNumber> returns 0.

Return Value

Type: Float
The number of decimal places displayed is determined solely by SetDecimal() regardless of SetFixed().
Remarks
SqRt() can be used anywhere in a numeric calculation to compute a square root (for example, in an expression that calculates standard deviation).
Examples
These examples show various results of SqRt():
X#
SetDecimal(5)
? SQRT(2)                                                // 1.41421
? SQRT(4)                                                // 2.00000
? SQRT(4) ^ 2                                // 4.00000
? SQRT(2) ^ 2                                // 2.00000
See Also