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

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

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -