HP 3000 Manuals

CSQRT (or CSQRT') [ Compiler Library/XL Reference Manual ] MPE/iX 5.0 Documentation


Compiler Library/XL Reference Manual

CSQRT (or CSQRT') 

CSQRT calculates the square root of a complex number.

Declaration 

Complex numbers in HP FORTRAN 77/XL programs are represented as an
ordered pair of real numbers:  one for the real part a and one for the
imaginary part b.  Thus, complex numbers occupy eight bytes.

        TYPE complex=RECORD
                      realpart:REAL;
                      imagpart:REAL;
                     END;

        FUNCTION CSQRT(VAR x:complex):complex; EXTERNAL;

Accuracy 

Depends on the accuracy of SQRT.

Attributes 

Parameter:                Any complex number representable in two real
                          numbers:  one for a and one for b.

Result:                   A complex number.

HP FORTRAN 77/XL:         Intrinsic function:  Y=CSQRT(X).

Error:                    If any part of the argument is a NaN, there are
                          two cases.  If the INVALID trap is enabled, the
                          message "COMPLEX SQRT: ANY PART OF THE ARGUMENT
                          = NaN" occurs.  Otherwise, the INVALID flag is
                          set.  In either case, a quiet NaN is returned
                          to both the real and imaginary part.



MPE/iX 5.0 Documentation