
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi guys,
I'm new here, coming from MT4. I have a problem and I don't know what is wrong. I want to divide the result of two functions stored in float variables, but the print is giving me zero. I found the error source to be the following, if I type "double a = 2/4; Print(a);" in the OnInit() or the OnTick() functions and I run it, the console returns me "0.0". It happens in all the cases where the result should be <1.
On more examples, 4/2 returns 2, 6/2 returns 3, but 5/2 also returns 2, so I think it is basically killing the decimal part. If I try with double variables, it behaves the same.
Have you any idea on why is this happening and how can I get over it?
Thanks a lot in advance.