sqrt¶

Purpose¶

Computes the square root of every element in x.

Format¶

y = sqrt(x)
Parameters

x (NxK matrix or N-dimensional array) – data

Returns

y (NxK matrix or N-dimensional array) – the square roots of each element of x.

Examples¶

let x[2,2] = 1 2 3 4;
y = sqrt(x);


The output, in variable y is equal to:

1.00000000
1.41421356
1.73205081
2.00000000


Remarks¶

If x is negative, complex results are returned by default. You can turn the generation of complex numbers for negative inputs on or off in the GAUSS configuration file, gauss.cfg and with the sysstate() function, case 8. If you turn it off, sqrt() will generate an error for negative inputs.

If x is already complex, the complex number state does not matter; sqrt() will compute a complex result.