A COUPLE OF COMPLEX CAVEATS. The Math::Complex package is tremendously useful, but there are a couple of things to beware. First, in perls that range from version 5.004_04 to 5.6.0, there is a bug in the Im() function. If you use the Im() function on a variable that is not of the Math::Complex class, it will return the real value of the variable. E.g., perl -MMath::Complex -le '$x=3; print Im($x);' will print out 3 instead of 0. If you are testing a variable to see if it is real or complex, don't use Im(), use the ref operator on the variable, and see if the resulting string is "Math::Complex". This bug has been fixed in version 5.6.1. Secondly, beware accidental stringification. I managed to do that in one of my tests, and lost a good deal of time trying to find out why I was getting strange results when I used (as it turned out) Re() and Im() on string variables, rather than Math::Complex variables. This is time I could have saved if I had only turned the warnings pragma on. The functions Re() and Im(), by the way, respectively return the real and imaginary parts of the complex number. This may prove useful if you are using this module to write to a file that will be read by other programs. FORMATTING COMPLEX NUMBERS Some may want to extend their options for formatting complex numbers. I have provided two functions for the cartesian form that are in the file complex.pl in the 't' test subdirectory. The functions are cartesian_format_signed($re_format, $im_format, @numbers) and cartesian_format($re_format, $im_format, @numbers) They work identically except for those times when the imaginary part of the complex number is negative. The first form uses the sign of the imaginary part in combining the two parts. For example: print cartesian_format_signed("%.15g ", " %.15gj", cplx(6.8, 1.1414)), "\n"; 6.8 + 1.1414j print cartesian_format_signed("%.15g ", " %.15gj", cplx(6.8, -1.1414)), "\n"; 6.8 - 1.1414j The second form simply formats the individual parts as requested in the formatting strings: print cartesian_format("%.15g + ", "%.15gj", cplx(6.8, -1.1414)), "\n"; 6.8 + -1.1414j print cartesian_format("[%.15g, ", "%.15g]", cplx(6.8, 1.1414)), "\n"; [6.8, 1.1414] print cartesian_format("[%.15g, ", "%.15g]", cplx(6.8, -1.1414)), "\n"; [6.8, -1.1414] Using undefs for the format strings gets you a default format of "%.15g" for the real and "%.15gi" for the imaginary.