Complex Results |
Results can have complex numbers if you enter an expression that contains a complex number. Even a Mathcad expression that involves only real numbers can have a complex value. For example, if you evaluate the square root of –1, Mathcad returns 1i.
When complex numbers are available, many functions and operators we think of as returning unique results become multivalued. In general, when a function or operator is multivalued, Mathcad returns the principal value: the value making the smallest positive angle relative to the positive real axis in the complex plane.
For example, when it evaluates (1)1/3, Mathcad returns .5 + .866i despite the fact that we commonly think of the cube root of –1 as being –1. This is because the number .5 + .866i makes an angle of only 60 degrees from the positive real axis. The number –1, on the other hand, is 180 degrees from the positive real axis. Mathcad's nth root operator, however, returns –1 in this case.
Complex results may have only a very small imaginary part, such as roots of rapidly varying equations found numerically. When the real and imaginary parts of a result have very different scale, tolerance settings control which parts of the result are displayed.