I know there's got to be a simple explanation but I can't see it,
I thought all these would be the same, I'm trying to put 51 in the highest byte of work.
but when the result is printed out, I get,
1326
0
855638016
The actual code,
What am I missing?
Thanks,
Mike.
I thought all these would be the same, I'm trying to put 51 in the highest byte of work.
Code:
uint32_t work;
work=51*(2^24);
work=51<<24;
work=51;
work<<=24;
1326
0
855638016
The actual code,
Code:
uint32_t work;
void setup(){
Serial.begin(115200);
work=51*(2^24);
Serial.println(work);
work=51<<24;
Serial.println(work);
work=51;
work<<=24;
Serial.println(work);
}
void loop(){
}
What am I missing?
Thanks,
Mike.