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]

Re: portable signed right shift


<<Sorry, I meant right shift of 2's complement signed number.
>>

I know, and that was my example

-5 = 11111111111111011

-2 = 11111111111111110

Most people would expect either
     11111111111111101 (if sign extension)
     01111111111111101 (if no sign extension)

and the divide will typically give

     11111111111111110


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