Illogical Type Changing
hey..im new arduino..i m experienced in c programming..i m gonna give little example..
in example..programe gave me illogical answer.. if changed types of 1400 , 1000 "long int" , right answer..but why have change type of these integer? these not long integer..of course result of 2 short integers's multiplication might long integer, here..so changed type of result..do u think logical? whats reason of usage? u think?
quote
long int myresult;
void setup()
{
serial.begin(9600);
}
void loop()
{
myresult=1400*1000;
serial.println(myresult);
while(1);
}
in example..programe gave me illogical answer.. if changed types of 1400 , 1000 "long int" , right answer..but why have change type of these integer? these not long integer..of course result of 2 short integers's multiplication might long integer, here..so changed type of result..do u think logical? whats reason of usage? u think?
nothing @ illogical 16 bit arithmetic.
Arduino Forum > Using Arduino > Programming Questions > Illogical Type Changing
arduino
Comments
Post a Comment