Download MetaTrader 5
To add comments, please log in or register
Sell your CPU capacity and earn money!
Roman
335
Roman 2015.03.21 15:52 

Can anyone make sense of this?

      double calc1, calc2;
      calc1 = 1000*(17.6/100);
      calc2 = calc1*(65/100);
      Alert("calc2=",DoubleToStr(calc2,2));

Here is what's returned:

Alert result

How is this possible???


Also tried this:

      double calc2;
      calc2 = 176*(65/100);
      Alert("calc2=",DoubleToStr(calc2,2));

The output once again:

Alert no.2


What the hell????!!!!?!?!?! o_O
Roman
335
Roman 2015.03.21 17:02  
Okay nevermind, I figured it out... apparently when you type in '65' it sees it as 'int' type... so you need to type it as '65.0'
/
To add comments, please log in or register