Download MetaTrader 5
To add comments, please log in or register
Find out the latest MQL5.community news!
Dominik
26
Dominik 2016.04.19 18:34 

Hi, 

 I am sitting here for hours now trying to fix this thing until it turned out that my calculator can easily get the wanted result, but it seems that MT4 cant.

 

I should show the result -2.35671324

 

using this calculation:   Print(((1/10)*23.56713241)*(-1));

 

 but instead it is showing -0.

 

Does someone know the reason? Do I need a specific Math-function for letting it calculate that?  

Alain Verleyen
Moderator
28517
Alain Verleyen 2016.04.19 18:46  
Deyaz:

Hi, 

 I am sitting here for hours now trying to fix this thing until it turned out that my calculator can easily get the wanted result, but it seems that MT4 cant.

 

I should show the result -2.35671324

 

using this calculation:   Print(((1/10)*23.56713241)*(-1));

 

 but instead it is showing -0.

 

Does someone know the reason? Do I need a specific Math-function for letting it calculate that?  

Because 1 and 10 are integer, so 1/10 is 0.

Try

Print(((1./10)*23.56713241)*(-1));
Dominik
26
Dominik 2016.04.19 19:07  
Wow, so simple. Thanks a lot! It worked. 
/
To add comments, please log in or register