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
Print your variables to the accuracy you desirer.
string price_to_string(double p){ return DoubleToString(p, _Digits); }
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
Print your variables to the accuracy you desirer.
I want to compare 2 float number which both of them were normalized using the above-mentioned code and they supposed to be equal, but I don't know why they are not equal when I compare them. (I insist on it again that both of them were normalized before)
The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum
Doubles are rarely equal.
The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum
even if they are normalized with the stated formula ?
even if they are normalized with the stated formula ?
Its truly strange ! because as I just re-normalized them exactly before comparing them and then the problem has been solved now !
The problem is just solved when I normalize them again and now they are equal!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi
I'm working with double numbers and after I normalize them with the following formula, it still remains non-normalized and has some digits that I don't need them.
I want to know is there anyway to assure that if the double has been normalized correctly or not. I mean a formula to get the digits of the double number.
the formula to normalize: