From: Paul Khuong <pvk@pv...>  20091113 15:53:19

On 20091113, at 8:50 AM, alexander a donkov wrote: > Dear Paul Khuong, > my name is alexander, i am a beginner user of sbcl (about a year). > I noticed your blog on complex float improvements in sbcl, x8664, > and that is why i am addressing this email to you. > > i noticed that the current 1.0.32 sbcl, at least when installed on > my mac, gives a different result when a real number is added to a > complex number with 0.0 imaginary part. [...] > Perhaps, the real number is now promoted to complex with a zero im > part, which is mostly ok, but comes into trouble when signed zeros > are considered. > My understanding of the problem with dealing with signed zeros comes > from the Kahan's article on complex arithmetic: > http://www.eecs.berkeley.edu/Pubs/TechRpts/1992/CSD92667.pdf This is intentional. The CL specification explicitly demands that (+ real complex) [or any other arithmetic operation] be equivalent to (+ real (complex complex)). Since we do not have a special case for complex floats with an exactly zero imaginary part, signed zeros get absorbed. Either interpretation of realcomplex arithmetic isn't hard to implement, but we should first decide whether we want to stray from the spec on that topic. Paul Khuong 