Hi to all. After some conditions were not executing on my code, I started scratching my head.
I am testing with an UNO. What is the expected output of this code?
void setup() {
// put your setup code here, to run once:
Serial.begin(57600);
}
void loop() {
// put your main code here, to run repeatedly:
int value = 5;
Serial.println(value);
Serial.println(value*10000);
Serial.println(value*20000);
Serial.println(value*30000);
Serial.println(value*40000);
Serial.println(value*50000);
Serial.println(value*100000);
Serial.println(value*1000000);
Serial.println(value*10000000);
Serial.println(value*100000000);
while(1);
}
I don't see anything wrong, but this is the output I am getting:
5
-15536
-31072
18928
200000
250000
500000
5000000
50000000
500000000
I'm wondering what is happening with the first values... When assigning value as long all is well, but is this really needed? :o