A truly amazing result!!! - page 7

 
MuruFigi >> :

Well, I kind of agreed on the second page that if so, we should not talk about a bug in the compiler, but about a bug in the brain of the developers. No offense, I made this thread rather for laughs.

What I don't understand now is this.

What is the MQL compiler developed on? If it is developed in a normal language, the programmers must have been crazed by the fact that multiplication and addition operations have equal priority. How could they have missed it? Does everyone really put parentheses where they want and where they don't? By the way, too, too many brackets make code clearer. And when your programmers write arithmetic operations like 2+3*4 they also write 2+(3*4), or God forbid a bug may slip into a C++ compiler and nesting of 100 brackets in one expression manually count it:)

This is a bug in brains of C, Java, Fortran, MathCad etc. etc. developers.


How you still don't get it!


ZS


Although, I admit, it took me a while to realise it too.

 
sol писал(а) >>

Although, I admit, it took me a while to realise this too.

It only now became clear why some logical combinations did not want to work properly. I had to add artificial brackets.

I could not explain it before. But I didn't bring up the subject either. I managed to find the right solution by poking around. But how many times I had to poke around to change everything?

 
nen >> :

It only now became clear why some logical combinations did not want to work properly. I had to add artificial brackets.

There was nothing to explain it earlier. But I didn't bring it up either. I managed to find the right solution by poking around. But how many times I had to poke around to find it all?

RTFM


*rofl*

 
MuruFigi >>: Does everyone really put parentheses where they should and where they shouldn't?

Well, not all in a row, of course, but I always do. And purely out of habit put them long before I found out about this "bug in the developers' heads. And why do I have to delve into Help one more time to figure out the priorities, if I can do without it, putting parentheses? So for me, this "bug" was not a disaster, although it amused me.

And before, when I wrote something Boolean in C, I also put them, although I didn't doubt about priorities. To be honest, I believe that a complex Boolean expression without brackets is not very readable.

P.S. Please do not use such a moronic example like 2+3*4. If such a smart move with priorities had happened for arithmetic operations, I would have absolutely no qualms about calling it a real bug.

By the way:

  1. The law of distributivity (opening of brackets):
    x 1 or (x 2 and x 3 ) = (x 1 or x 2 ) and (x 1 or x 3 )
    x 1 and (x 2 or x 3 ) = (x 1 and x 2 ) or (x 1 and x 3 )
  2. ...

It follows that from the point of view of Boolean algebra, the and and operations have the same priority.

Andrei, what made you conclude that priorities of these operations in Boolean algebra are equal? Counter-example:

at a=1, b=0, c=0

(a or b) and c = (1 or 0) and 0 = 0

a or (b and c) = 1 or (0 and 0) = 1

 
If the developer was from abroad, the topicstarter would be at least thanked for finding the bug. And the topic would have been quickly closed referring that the work on the fix is already in full swing: they value their reputation (it costs a lot of money). And we say "you fool", read the documentation, specifications, tables, etc. This would not be the case if MT4 had a competitor.
 
MuruFigi >> :

What is the MQL compiler developed in? After all, if it is developed in a normal language, the programmers should have been first of all shocked by the fact that their multiplication and addition operations have equal priority. How could they have missed it?

Well, here's another example of overreaching. And yet the topic starter reports that he started the thread as a joke, and had read the documentation by this point after all.

 
Rosh >> :

Well, here's another example of overreaching. And yet the starter says he started the topic as a joke, and has read the documentation by this point after all.

I've got it :-) Maybe it's true that great discoveries are made at ease with very different goals.

 
Galaxy >> :

I've had enough of it :-). Maybe it is true that great discoveries are made at ease, having quite different purposes.

This "discovery" hardly qualifies as a great discovery. It is worth just stating the fact and forgetting about it. In general, the subject of the priority of boolean operations is farfetched: it would be cheaper for developers to simply prohibit building boolean expressions with different operations without brackets and consider such constructions as invalid.

 
Mathemat >> :

Andrew, from what do you actually deduce that the priorities of these operations in Boolean algebra are equal? Counterexample:

at a=1, b=0, c=0

(a or b) and c = (1 or 0) and 0 = 0

a or (b and c) = 1 or (0 and 0) = 1

a = beautiful

b = smart

c = rich

x = a && b && c ;

y = a || b || c ;


I wonder which you would prefer, Andrei: x = 1 or y = 1 ?

 
Mathemat >> :

Andrew, from what, in fact, did you deduce that the priorities of these operations in Boolean algebra are equal?

From the symmetry of operations. And the symmetry of operations follows directly from the allocated formulas.

One symmetric operation cannot take precedence over another.

>> :

I wonder, what Andrey would prefer: x = 1 or y = 1 ?

I would prefer, Eric, to argue without getting personal and sneering.

___________________________________

Anyway, my point is.

The result of the expression A && B || C is undefined in terms of Boolean algebra.

Reason: