[BUG] Why does this happen?

 

Can anyone explain to me why this happens?

double result = 15/100;
Print("15/100 = " + result);

Console: 2013.09.17 15:01:25    Test EURUSD,Daily: 15/100 = 0.00000000
 
rodrigopaitach:

Can anyone explain to me why this happens?

You might want to review Type Casting.

Since 15 and 100 are both ints, the resulting quotient is also an int. Then the int is target-typecasted to a double. If you want the resulting quotient to be a double, make either the dividend or divisor (or both) a double--for example, by adding a decimal point to one or both.

double result = 15.0/100.0;