bit shift - How do I translate the >>> operator in JavaScript to VB.NET? -
i doing code conversion javascript vb.net. stuck >>> operation.
see sample code , attempt below:
javascript:
function test(a, b) { return (a << b) | (a >>> (32 - b)) }
my attempt in vb.net:
private function test(byval integer, byval b integer) integer return ((a << b) or (cushort(a) >> (32 - b))) end function
what doing wrong?
you should use cuint instead of cushort.
cushort gives ushort 16-bit in size. in javascript bit operations done in 32-bit, a
should converted 32-bit unsigned type — uinteger.
Comments
Post a Comment