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

Valutazione Template - Joomla! Forum - community, help and support

SD Datastring Convention

First use of Arduino Uno : avrdude error on Blink uploading