Marraco
January 16th, 2009, 12:06 PM
this help link (No works in Firefox, only in IE)
ms-help://MS.VSCC.v90/MS.msdnexpress.v90.en/dv_vbalr/html/fdb93d25-81ba-417f-b808-41207bfb8440.htm
says:"Arithmetic shifts are not circular, which means the bits shifted off one end of the result are not reintroduced at the other end. In an arithmetic left shift, the bits shifted beyond the range of the result data type are discarded, and the bit positions vacated on the right are set to zero."
But then gives an example:
Dim pattern As Short = 192
' The bit pattern is 0000 0000 1100 0000.
Dim result4 As Short
'...
result4 = pattern << 17
The results of the previous example are as follows:
...
result4 is 384 (0000 0001 1000 0000).
...
but that result is only possible if the Shift IS circular.
then it says:
The shift amount for result4 is calculated as 17 AND 15, which equals 1.
I don't get it.
ms-help://MS.VSCC.v90/MS.msdnexpress.v90.en/dv_vbalr/html/fdb93d25-81ba-417f-b808-41207bfb8440.htm
says:"Arithmetic shifts are not circular, which means the bits shifted off one end of the result are not reintroduced at the other end. In an arithmetic left shift, the bits shifted beyond the range of the result data type are discarded, and the bit positions vacated on the right are set to zero."
But then gives an example:
Dim pattern As Short = 192
' The bit pattern is 0000 0000 1100 0000.
Dim result4 As Short
'...
result4 = pattern << 17
The results of the previous example are as follows:
...
result4 is 384 (0000 0001 1000 0000).
...
but that result is only possible if the Shift IS circular.
then it says:
The shift amount for result4 is calculated as 17 AND 15, which equals 1.
I don't get it.