Hello,
I'm trying to do some bit operations (esp. OR) on bytes and get some very strange results. I boiled it down to:
I guess it has something to do with the fact the Bit operators return ints, but still I don't get it ?
I'm trying to do some bit operations (esp. OR) on bytes and get some very strange results. I boiled it down to:
B4X:
Dim foo as byte = 0
foo = Bit.OR (foo, Bit.ShiftLeft(1, 7))
Bit.ToBinaryString (foo) 'I would except to get 10000000,but I get 1111111111111111111111110000000 ?
I guess it has something to do with the fact the Bit operators return ints, but still I don't get it ?
Last edited: