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.6
Syntax
 FUNCTION SQrt(
	nNumber AS USUAL
) AS FLOAT
Request Example 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#
1SetDecimal(5)
2? SQRT(2)                        // 1.41421
3? SQRT(4)                        // 2.00000
4? SQRT(4) ^ 2                // 4.00000
5? SQRT(2) ^ 2                // 2.00000
See Also