Documentation/Calc Functions/COMPLEX
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
Function name:
COMPLEX
Category:
Add-in
Summary:
Constructs a complex number as text, given its real and imaginary parts.
Syntax:
COMPLEX(RealNumber; ImaginaryNumber[; Suffix])
Returns:
Returns a text string which is the complex number constructed from the given real and imaginary parts, using the given or default imaginary unit.
Arguments:
RealNumber is a real value, or a reference to a cell containing that value, which is the real part of the complex number.
ImaginaryNumber is a real value, or a reference to a cell containing that value, which is the imaginary part of the complex number.
Suffix is the string, or a reference to a cell containing that string, which comprises the letter to be used as the imaginary unit; either “i” or “j” (lowercase only). If omitted, “i” is used.
- If either RealNumber or ImaginaryNumber is non-numeric, then COMPLEX reports a #VALUE! error.
- If Suffix is set to something other than “i” or “j”, COMPLEX reports an invalid argument error (Err:502).
Additional details:
General information about Calc's handling of 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 |
---|---|---|
=COMPLEX(1; 2) | Here the function returns the complex number string using the default "i" as the imaginary unit. | 1+2i |
=COMPLEX(−3; 4; "j") | Here the function returns the complex number string using the specified "j" as the imaginary unit. | -3+4j |
=COMPLEX(F1; F2; F3) where cells F1 and F2 contain the values 1.23 and -4.56 respectively and cell F3 contains the character "j". | Here the function returns the complex number string constructed using values entered in the specified cells. | 1.23-4.56j |
=COMPLEX(120,000,000,000,000,000; 34,000,000,000,000,000) | Here the function returns the complex number string using real and imaginary parts specified in scientific (E) notation. | 1.2e+17+3.4e+16i |
Related LibreOffice functions:
None.
ODF standard:
Related (or similar) Excel functions:
COMPLEX