This is the mail archive of the gcc@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]

Stupid off-topic question


I can't understand this logic.

-1 % 4083 -> -1

But

 -1 % (unsigned)4083 -> 2433.

I would expect by any reasonable mathematical definition, that 

-1 % 4083 -> 4082.

This was gcc-2.95.2 i686-pc-linux-gnu.

If the generated code is really that stupid, maybe gcc should give a
warning?

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