Math calculation wrong

Back to topics list To post a new topic, please log in or register
avatar
9
Deyaz 2016.04.19 20: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?  

avatar
Moderator
3206
angevoyageur 2016.04.19 20: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));

 

avatar
9
Deyaz 2016.04.19 21:07 #
 
Wow, so simple. Thanks a lot! It worked. 
avatar
12985
Back to topics list  

To add comments, please log in or register