[Bug c/59961] Use of size_t in leading term of computation with subtraction
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 27 22:30:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59961
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Olaf from comment #3)
> Well... naive me found it quite surprising and unexpected that the following
> two lines produce grossly different results:
>
> double result1 = -s1*d1 + s2*d2;
> double result2 = s2*d2 - s1*d1;
-s1*d1 + s2*d2; is the same as (-s1)*d1 + s2*d2 that is the unary minus binds
to the left and has a higher precedence than the plus operator.
More information about the Gcc-bugs
mailing list