This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/22072] bizarre code for int*int/2


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-17 01:08 -------
(In reply to comment #8)
> did i miss something in my math? 

Yes in C, % (remainder and not mod) is negative iff one of the operands is negative.
so it is -2*2 + -1 = -5. , integer divide in C is truncated.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22072


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]