Hi all,
I have the following code:
unsigned long a; long b; long result;
After a and b are given by some values, I want
result = a - b;
If I explicitly express this expression using cast like the following:
result = (long)(a-b);
The compiler can still compile, but the result seems wrong.
I also tried casting like the following:
result = (long)(a-(unsigned long)b);
The compiler can still compile, but the result seems wrong.
But, if I do something like the following, the result is correct.
result = a-(unsigned long)b;