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

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -