0

So what happens when you OR two negative numbers? Is it ever guaranteed that whenever you OR a positive with a negative, the result will be positive?

Bondolin
  • 2,793
  • 7
  • 34
  • 62

1 Answers1

1

Assuming two's complement:

Whenever you OR any number with a negative number the result is negative. This is because the sign bit is set in the negative number and therefor will be set in the resulting number.

Konrad Lindenbach
  • 4,911
  • 1
  • 26
  • 28