SQRT Function

Calculates the square root of the input variable.

enabled.

Usage

result = SQRT(x)

Input Parameters

x—The value or array of values for which the square root is desired.

Returned Value

result—The square root of x.

Keywords

None.

Discussion

SQRT handles complex numbers (defined by c = a + ib), in the following manner:

where:

The ambiguous sign is taken to be the same as the sign of b.

If x is of double-precision floating-point or complex data type, SQRT yields a result of the same type. All other types yield a single-precision floating-point result.

If x is an array, the result of SQRT has the same dimensions, with each element containing the square root of the corresponding element of x.

Example

x = [3, 5, 7, 9]
PRINT, SQRT(x)
; PV-WAVE prints: 1.73205    2.23607    2.64575    3.00000