IDL

REAL_PART

REAL_PART

The REAL_PART function returns the real part of its complex-valued argument.

Examples


The following example demonstrates how you can use REAL_PART to obtain the real parts of an array of complex variables.

; Create an array of complex values:
cValues = COMPLEX([1, 2, 3],[4, 5, 6])
; Print just the real parts of each element in cValues:
PRINT, REAL_PART(cValues)

IDL prints:

 1.00000   2.00000   3.00000

Syntax


Result = REAL_PART(Z)

Return Value


If the complex-valued argument is double-precision, the result will be double-precision, otherwise the result will be single-precision floating-point. If the argument is not complex, then the result will be double-precision if the argument is double-precision, otherwise the result will be single-precision.

Arguments


Z

A scalar or array for which the real part is desired. Z may be of any numeric type.

Version History


5.5

Introduced

See Also


COMPLEX, DCOMPLEX, IMAGINARY


This information is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However, it may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
© 2017 Exelis Visual Information Solutions, Inc., a subsidiary of Harris Corporation