How to convert the signed DWORD to Unsigned DWORD ?
I have one method of doing which is Two's complement.
But, when i did, compiler is giving an error that bitwise operation isnt allowed for signed numbers (as per the MISRA rule 2004 12th rule) .
so then how can i convert to unsigned Dword?
long int num1,num2,
unsigned long int num3;
num1 = 293;
num2 = 296;
num3 = num1 - num2;
if i run the code then num3 is loaded with some 0xFFFFFFE somevalue like this.
but actually the desired value 3 should get store?
so i made the unsigned long int num3 to long int num3.
Then num3 signed value (-3 in this case) should be converted to 3 without doing twos complement?