Hello Angel Fire
I wouldn't say that you are wrong but there is an error and therefor I will try to explain you step by step, OK?
Let's start from the beginig
you said that you always use -64<<-4 ==> x * 2^y and on the end it results in -4, am I correct or misunderstood something???
but the correct result is 0.
How did i come to 0.
let's first resolve left side -64, way to tranform -64 into bynary represantation is first write 64
64 0000.0000.0000.0000.0000.0000.0100.0000
~64 1111.1111.1111.1111.1111.1111.1011.1111
add 1 0000.0000.0000.0000.0000.0000.0000.0001
-----------------------------------------
result 1111.1111.1111.1111.1111.1111.1100.0000 it represents -64
now let's resolve right side -4, will will do the same process as we done with -64.
4 0000.0000.0000.0000.0000.0000.0000.0100
~4 1111.1111.1111.1111.1111.1111.1111.1011
add 1 0000.0000.0000.0000.0000.0000.0000.0001
-------------------------------------------
res. 1111.1111.1111.1111.1111.1111.1111.1100 ok, its represent -4
but pay attension here, now you must take in consideration only five right-most bits ( 1.1100 and this is 28 OK ) (probably you ask why five ? because only with 5 bits you can represen range from 0 to 31 - range of shifting for int type or 6 bits in case of long) am i clear???
finally on the and what we have is
1111.1111.1111.1111.1111.1111.1100.0000 << 28 =
0000.0000.0000.0000.0000.0000.0000.0000 = 0
If i am wrong please correct me.
