Documentation/Calc Functions/IMREAL

From The Document Foundation Wiki
Jump to navigation Jump to search

Function name:

IMREAL

Category:

Add-in

Summary:

Extracts the real part of a complex number.

Syntax:

IMREAL(ComplexNumber)

Returns:

Returns a real number which is the real part of the complex number passed as argument.

Arguments:

ComplexNumber is a string (in quotation marks) representing a complex number in the form a+bi or a+bj, or a reference to a cell containing that string, whose real part is to be extracted. a and b are real numbers.

  • If ComplexNumber is not a valid complex number, IMREAL reports an invalid argument error (Err:502).

Additional details:

Details specific to IMREAL function

For a complex number of the form a+bi or a+bj, the IMREAL function extracts and returns the value a.

General information about Calc's handling of complex numbers

Note pin.svg

For convenience, the information in this subsection is repeated on all pages describing functions that manipulate complex numbers.


  • A complex number is a number that can be expressed in the form a+bi, where a and b are real numbers and i is a symbol for the imaginary unit, such that i2=−1. a is known as the real part of the complex number and b is known as its imaginary part.
  • In some disciplines using i to indicate the imaginary unit may be undesirable and, in such cases, the symbol j may be used instead. The functions provided by Calc to process complex numbers can use either i or j.
  • For additional general background information, visit Wikipedia’s Complex number page.
  • Within Calc, a complex number is represented as a string expression of the form "a+bi" or "a+bj", where a and b are real numbers. If the complex number happens to be a real number (b=0), then it can be represented as either a string expression or a numeric value. Complex number string expressions should not contain any space characters. Examples of valid Calc complex numbers include "2", -6, "2+3i", "3j", "12.34+56.78i", and "1e+23-1e-22j". Calc would not recognize the strings "1+j2", "i+1", and "i+j" as valid complex numbers.
  • The representation of the complex numbers in strings can have up to 15 significant digits and scientific style is automatically used if needed (visit Wikipedia’s Scientific notation page for more information). The decimal delimiter in complex number string expressions is always a dot, irrespective of locale setting.

Examples:

Formula Description Returns
=IMREAL("5+12i") Here the function extracts the real part of a complex number that uses the imaginary unit i. 5
=IMREAL("12.34-56.78j") Here the function extracts the real part of a complex number that includes fractional values for real and imaginary parts, and uses the imaginary unit j. 12.34
=IMREAL(D1) where cell D1 contains the complex number 2-3i. Here the function extracts the real part of a complex number that is entered in a cell. 2

Related LibreOffice functions:

IMABS

IMAGINARY

IMARGUMENT

ODF standard:

Section 6.8.19, part 2

Equivalent Excel functions:

IMREAL