[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 9.261 SqRt

### Synopsis

    function SqRt (x: real type): real type;

or

    function SqRt (z: Complex type): Complex type;

### Description

Returns the positive square root of the argument.

For real arguments, it is an error if the argument is negative.

For complex arguments, ``SqRt'` returns the principal value of the root of the argument, i.e. the root with positive real part, or, if the real part is zero, that one with positive imaginary part.

### Conforming to

The function ``SqRt'` is defined in ISO-7185 Pascal; its application to complex values is defined in ISO-10206 Extended Pascal.

### Example

    program SqRtDemo;

    var
      m1: Complex;

    begin
      m1 := Cmplx (-1, 0);  { -1 }
      WriteLn (Re (SqRt (m1)) : 6 : 3, Im (SqRt (m1)) : 6 : 3);
        { yields 1.000 -1.000, i.e. the imaginary unit, i }
    end.

### See also

section 9.200 pow, section 9.260 Sqr, section 8.3 Operators.

This document was generated by Frank Heckenbach on May, 10 2002 using texi2html