David LECOMTE

Declaration type

Discussion created by David LECOMTE on Jun 4, 2009
Latest reply on Jun 4, 2009 by CrasyCat

I don't understand why theses following operations could be OK or NOK when i run program with simulator.

 

void main()

{

long number;

number = 1000*33; //The result is -32536

}

 

void main()

{

long number;

number = 1000*3.3*10; //The result is 33000

}

 

Do you have any explanations? In fact i would like do a big operation what king of type number declaration i will use?

Thanks a lot

david

Outcomes