aimag

Date:

10-12-2011

NAME

AIMAG, DIMAG - Return imaginary part of a complex number

SYNOPSIS

AIMAG ([Z=]z)
DIMAG ([Z=]z)

STANDARDS

Fortran

Fortran extension: DIMAG

DESCRIPTION

AIMAG and DIMAG return the imaginary part of a complex number. AIMAG is the generic function name; the others are specifics. These are elemental intrinsic functions. These functions accept the following argument:

x

Must be of type single-precision complex or double-precision complex. See the RETURN VALUES section for information on input data types and return values.

These functions evaluate

y = xi

where

z = xr ... xi

NOTES

The AIMAG intrinsic function name can be passed as an argument; DIMAG cannot.

RETURN VALUES

AIMAG returns the imaginary part of its complex argument with the same kind type parameter as its complex argument.

DIMAG returns the double-precision imaginary part of its double-precision complex argument.

EXAMPLES

The following program gives the imaginary part of the complex number (1.0,2.0). After running the program, RESULT = 2.0.

PROGRAM AIMTEST
REAL RESULT
RESULT=AIMAG( (1.0,2.0) )
PRINT *, RESULT
STOP
END