Mixed mode arithmetic
Mixed mode expressions are handled correctly.
Real values will be converted to complex where necessary.
For example:
complex xx(3.5,4.0);
complex yy = log(yy) + log(3.2);
This expression involves a mixture of real values:
log(3.2),
and complex values:
log(yy)
and the sum.
Another example of mixing real and complex,
xx=1,
is equivalent to
xx=complex(1)
which in turn is equivalent to
xx=complex(1,0).
The interpretation of the expression
(xx+1)yy3.2
is
(((xx+complex(1))yy)complex(3.2)).
Next topic:
Mathematical functions
Previous topic:
Arithmetic operators
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004