Try this:
MathAbs(879) / 10
or,
NormalizeDouble(MathAbs(879) / 10, 1)
All these things are described here https://www.mql5.com/en/docs/basis/types/double and here https://www.mql5.com/en/docs/basis/operations/relation
Documentation on MQL5: Language Basics / Data Types / Real Types (double, float)
- www.mql5.com
Language Basics / Data Types / Real Types (double, float) - Documentation on MQL5
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.
i'm experiencing a very strange problem with division between doubles.
If i try do divide a double just rounded via MathRound by 10, often i obtain a precision error:
Ex:
879.0 / 10 = 87.9000000001
980.0 / 10 = 97.9999999999
164.0 / 10 = 16.4
Nothing wrong in multiplication (1.10 * 10 = 11.0 correct! ).
I have tested this behavior in two separated environment with same results.
Regards Gianluca