-
m_value2 = 0.073; m_value2 = 0.0365
Floating-point has infinite number of decimals, it's your not understanding floating-point and that some numbers can't be represented exactly. (like 1/10.)
Double-precision floating-point format - Wikipedia, the free encyclopedia - Problems with MathMod/fmod
Checking for Price multiples of 20 points to Pyramid trade - Best EA - MQL4 programming forum
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
I'm essentially trying to produce this code:
but actually using variables as such:
The results from the first code are correct (0.0) but I'm getting m_mod to equal 0.037 from the second form which is obviously wrong.
I thought it could be type conversion issue but couldn't see anything wrong. Any ideas what I'm doing wrong to get the invalid value.
Thanks in advance.