Contents Previous Next Subchapters

The Square Root Function
Syntax sqrt(x)
See Also: log , exp , hypot

Returns the element-by-element square root of x, where the elements of x are complex or non-negative real or double-precision numbers.

     a = 3.0
     b = 4.0
     sqrt(a^2 + b^2)

Negative Arguments
Normally the return type for an element-by-element function is the same as its argument. This is the case for the sqrt function unless one of the elements of x is less than zero in which case the return value is complex.

If you enter
     sqrt([1., -1.])
O-Matrix will respond
     [ (1,0), (0,1) ]