Errors, bugs, questions - page 2622

 
Noticed this bug on website in private messages on my phone.
It doesn't work refreshing page in standard swipe down way.

. Appeared maybe 1 month or 2. I just wasn't paying attention.

Phone is on android 10 if important.
Going into private messages and if a new. message has arrived, it doesn't always update automatically.

And when I refresh with my finger( top down) it has also stopped refreshing.

I have to press the private message icon again.

Bug only in private messages.
Update: this only happens on samsung internet.
Rather a problem with it after the update.

In chrome everything is ok.
 

Why in line 3:

  datetime dt = 0;
  ulong x = 0;
  if(dt < x) x++;

"sign mismatch" warning?

Datetime is supposed to be an unsigned number (8 bytes like ulong). Give me an example of a negative date.

 

Tell me how to debug ex5 libraries?

There is a library that worked for several years without any problems. However, after some compiler changes in the latest builds, a pointer function call from the library ends with an "invalid function pointer call" error. If the source of the library is included in the Expert Advisor directly through the link, there is no error.

In general, you need some way to compare types of pointers(function prototypes), generated in the library and in the Expert Advisor, which loads the library.

The suport is closed. I will not show the source code from the marketplace here.

For reference, with the same source code, library call worked fine in build 2190.
 
Stanislav Korotky:

For reference, with the same source code, a call from the library worked fine in build 2190.

In 2170 I no longer have pointers to functions, here is an example that still works in MQL4, but no longer works in MQL5

https://www.mql5.com/ru/forum/323539/page3#comment_13444791

 
Igor Makanu:

I stopped working with function pointers in 2170. Here is an example that still works in MQL4, but stopped working in MQL5

https://www.mql5.com/ru/forum/323539/page3#comment_13444791

I have read it. I have a different case. But this is probably the consequence of the same "tightening of the screws". However, good practices in this case implies human instructions for migration of existing developments with examples or availability of a caliper.

 

Quite entertaining mathematics

//+------------------------------------------------------------------+
double volume_step = 0.01;
void OnStart()
  {
   int total = 10;
   double aVolume = 0.01;
   
   for(int i=0; i<total; i++)
     {
      aVolume = volume_step * MathFloor(aVolume / volume_step);
      Print(DoubleToString(aVolume,8)+"   "+ DoubleToString(volume_step,2)+"   "+DoubleToString(MathFloor(aVolume / volume_step),2)+"  Next lot = "+(aVolume+0.01));
      aVolume+=0.01;
     }
  }
//+------------------------------------------------------------------+

Result

2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.0699999999999999999As 0.06000000 + 0.01 becomes 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.05000000 0.01 5.00 Next lot = 0.06
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.04000000 0.01 4.00 Next lot = 0.05
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.03000000 0.01 3.00 Next lot = 0.04
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.02000000 0.01 2.00 Next lot = 0.03
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.01000000 0.01 1.00 Next lot = 0.02


 
Vladimir Pastushak:

Quite remarkable mathematics

How does 0.06000000 + 0.01 become 0.069999999999999999999

because 0.069999999999999999999 is the nearest number to 0.07 which can be represented by type double

 
Vladimir Pastushak:

Quite entertaining maths

Result

2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.06000000 0.01 6.00 Next lot = 0.0699999999999999999 As 0.06000000 + 0.01 becomes 0.069999999999999
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.05000000 0.01 5.00 Next lot = 0.06
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.04000000 0.01 4.00 Next lot = 0.05
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.03000000 0.01 3.00 Next lot = 0.04
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.02000000 0.01 2.00 Next lot = 0.03
2020.01.05 17:09:28.798 Testert EURUSD,H1: 0.01000000 0.01 1.00 Next lot = 0.02


Please read the docks and you will be happy.

And on the subject: IEEE 754, - study it.

 
Igor Makanu:

because 0.069999999999999999999 is the closest number to 0.07 which can be represented by type double

Vladimir Simakov:

Read the docs and you will be happy.

On the subject: IEEE 754, - study.

What are you teaching him... he has 49 published products on the marketplace. He already knows everything himself....
 
Alexey Viktorov:
What are you teaching him... he has 49 published products on the marketplace. He already knows everything himself....

So you are suggesting that those who post on the Market should be ignored? I'm not sure I would want to do that, there was a question, there was a discussion, I think it's a normal situation

PS:

on top of that .... try to unprint double via printf(), I have a suspicion, there will be a lot of "how many wondrous discoveries the spirit of enlightenment prepares for us..."

;)

Reason: