Is this a bug in MT5 - Strange behavior with a double input

 

Hi There

One of my clients recently reported this to me. Seems to be a very strange bug in the MT5 system.

It only does this when 0.07 is used.

Anyone else experience this.



 
  1. How To Ask Questions The Smart Way. 2004
              Don't rush to claim that you have found a bug.
    Questions Not To Ask
              My program doesn't work. I think system facility X is broken.

  2. 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

    See also The == operand. - MQL4 programming forum

    Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.

    If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
              question about decima of marketinfo() - MQL4 programming forum 2016.05.18

 
William Roeder:
  1. How To Ask Questions The Smart Way. 2004
              Don't rush to claim that you have found a bug.
    Questions Not To Ask
              My program doesn't work. I think system facility X is broken.

  2. 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

    See also The == operand. - MQL4 programming forum

    Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.

    If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
              question about decima of marketinfo() - MQL4 programming forum 2016.05.18

Hi There

Didn't say it is a bug I asked if it was a bug.

m_trade.Buy(long_lot,m_symbol.Name(),m_symbol.Ask(),sl,tp))

The above function accepts a double as the lot size.

Therefore using DoubleToString(long_lot,2) which I do elsewhere will not work.

I also see this has come up before elsewhere 

https://www.mql5.com/en/forum/153169

Storing 0.07 as a double - impossible???
Storing 0.07 as a double - impossible???
  • 2014.09.21
  • www.mql5.com
Is it just me, or can 0.07 not be stored accurately? Example This displays as 0...
 
STANTON ROUX:

Hi There

Didn't say it is a bug I asked if it was a bug.

m_trade.Buy(long_lot,m_symbol.Name(),m_symbol.Ask(),sl,tp))

The above function accepts a double as the lot size.

Therefore using DoubleToString(long_lot,2) which I do elsewhere will not work.

I also see this has come up before elsewhere 

https://www.mql5.com/en/forum/153169

please post the code. Why double to string?