I have code:
signed short a = -32740;
float c;
float b;
b = (signed short)(a << 4);
c = a << 4;
printf("(signed short)(a << 4): %f\n", b);
printf("(a << 4): %f\n", c);
output:
(signed short)(a << 4): 448.000000
(a << 4): -523840.000000
Why 16 senior registers not reset after the shift (c = a << 4;)?
Program executed on x86 machine with 32-bit linux.
This line does the following:
This line does the following:
The fact that ‘a’ is declared as a signed short does not make a difference because all calculations are always done with the int datatype. I assume that your system has 32 bit integers.