Bitwise operations - very unexpected results on Arduino.


why code have different result when run on arduino, when run on pc?

code: [select]
serial.println((0<<24 | 18<<16 | 176<<8 | 83));


expected result (on pc): 1224787
unexpected result (on arduino): -20397


i tried think of including casing every single value unsigned integers, casting result unsigned integer, using variables , many more things forgot... nothing worked.

so questions are:
why happening?
how can expected result on arduino?

cast them uint32_t.


Arduino Forum > Using Arduino > Programming Questions > Bitwise operations - very unexpected results on Arduino.


arduino

Comments

Popular posts from this blog

ffmpeg h264_omx encoder - libomxcore.so missing. - Raspberry Pi Forums

'setTime' was not declared in this scope

php - Class PDO not found in laravel 5.2 -