complex arithmetic in gcc (and various standards)
Gabriel Dos Reis
gdr@integrable-solutions.net
Mon Oct 2 18:56:00 GMT 2006
Paolo Carlini <pcarlini@suse.de> writes:
| Hi Gaby
|
| > | > My question was a slightly different one. To me it is not clear
| > whether the | > standard allows the treatment of (r,0) as r in
| > complex operations. For | > example: is it allowed to handle
| > (r,0)*(x,y) as r*(x,y)?
| > | | I don't think so; at least, it might affect negative 0.
| >
| >Hmm, how?
| >
| I'm not sure if the following is exactly Joseph' point, but I'd like
| to know your opinion about it anyway: if you look to Comment #19 in
| the audit trail of PR 28408, I noticed that, due to the rule about
| signed zero (with default rounding):
| (+0) + (-0) = +0
The rule is correct -- i.e. agrees with IEEE-756.
| the result of the "same" multiplication considered as complex *
| complex (vs complex * real) has a different sign for the zero
| imaginary component.
Thanks for the example. I'm not sure this was anticipated by the C++
specification. I suspect I have to raise this on LWG.
-- Gaby
More information about the Gcc
mailing list