Hello all, I have a local branch which allows Guile to represent non-real complex numbers with inexact zero imaginary part, such as 1.0+0.0i. Currently, Guile automatically converts these numbers into reals. As pointed out by Taylor Campbell and others, it is important to distinguish -1.0+0.0i from -1.0-0.0i in order to handle branch cuts properly.
In one of my pending patches (not yet submitted), I made sure that any negative number (or -0.0) raised to any inexact power always yields a non-real complex number. For example, although (expt -1.0 2) yields 1.0, (expt -1 2.0) yields 1.0+0.0i, which is not `real?' according to the R6RS. The R6RS requires that `real?' return #t only if the imaginary part is an _exact_ 0. Note that operations requiring reals, including the comparison operators `<', '>', '<=' and '>=' will raise an exception if applied to these numbers. However, I made sure that `inexact->exact' would ignore an inexact zero imaginary part. I don't expect this to be a problem, since anyone raising a negative number to an inexact power should expect that the result may not be real. What do you think? Mark