M
Marty McFly
Hello VB Gurus,
I have an unusual requirement to shift an unsigned int right one bit:
Dim myVar As UInt32 = UInt32.Parse("123456")
Dim myResult As UInt32
myResult = myVar >> 1
However, the >> operator only works on Byte, Short, Integer, and Long.
I also tried to convert to binary and manually shift the bits, but I only
found ways to go from binary to string--not back to binary.
Does anyone know how this could be done? (I'm not too concerned about
performance, so even resource-killing string manipulation would be fine with
me.)
Thank you,
Marty
I have an unusual requirement to shift an unsigned int right one bit:
Dim myVar As UInt32 = UInt32.Parse("123456")
Dim myResult As UInt32
myResult = myVar >> 1
However, the >> operator only works on Byte, Short, Integer, and Long.
I also tried to convert to binary and manually shift the bits, but I only
found ways to go from binary to string--not back to binary.
Does anyone know how this could be done? (I'm not too concerned about
performance, so even resource-killing string manipulation would be fine with
me.)
Thank you,
Marty