Portable documents shall use
complex numbers only in functions that are explicitly noted as
accepting or producing complex numbers (as appropriate). In
particular, note that infix operators (including "+", "-",
"*", "/", "^", "=") may not
support complex numbers, and applications may not y include
such support. The results of using an operator on a complex number,
such as COMPLEX(2;3) + COMPLEX(4;5), are implementation-defined and
may produce an Error instead of Complex. Portable documents shall
use the complex number functions instead of operators to work
portably with complex numbers, and should use COMPLEX to
produce arbitrary complex numbers from a (real,imaginary) pair. For
example, the portable expression IMSUM(COMPLEX(2;3); COMPLEX(4;5))
adds the numbers 2+3i to 4+5i (resulting in 6+8i). Thus, portable
documents that use complex numbers shall
use the functions instead when a value may be a complex number:
IMSUM (not infix "+")
IMSUB (not infix "-")
IMPRODUCT (not infix "*")
IMDIV (not infix "/")
IMPOWER (not "^", but see its
definition for limitations)
For prefix "-", IMSUB with the
first value 0 may be used.
Note: Evaluators differ in support offered for
complex numbers. The likelihood of successful interchange of
documents containing expressions using complex numbers will be
increased by limiting them to using functions defined in OpenFormula
for use with complex numbers.
Query functions supported on complex
numbers include IMREAL (returns real part), IMAGINARY (returns
imaginary part), IMABS (returns magnitude), IMARGUMENT (returns the
angle expressed by the complex number).