Problem in calculating the result of subtraction of numbers in mql5

 
Hello friends
The result of the following code equation is 21, if it should be -1!!

Where is the problem, please help.

Comment(10 - (-11));
 
mansour afshar:
Hello friends
The result of the following code equation is 21, if it should be -1!!

Where is the problem, please help.

The result of the expression `10 - (-11)` is indeed 21, not -1. Let me explain why:

In this expression, you're subtracting a negative number from a positive number. When you subtract a negative number, it's the same as adding the positive of that number.

So, `10 - (-11)` is equivalent to `10 + 11`, which equals 21, not -1.

If you want the result to be -1, you would need to write the expression as `10 - 11`, which subtracts 11 from 10, resulting in -1.