I have some issue to convert a javascript code into c# the issue is with bitwise operator:
Javascript function: return (s - (s | 0x0)) * 0x100000000 | 0x0;
C# function; return (long)((s - ((long)s)) * 0x100000000);
If s = 1.7320508075688772 on Javascript report -1150833019 on c# report 3144134277
other example can be Javascript: (1779033703 << 0x1e) = -1073741824 c# (1779033703 << 0x1e) = 1910222893216694272
What i need is translate Javascript function into c# with same number result.
Thanks for help.
(int)3144134277Uor(int)3144134277UL, maybe?>>produces a signed 32-bit integer in JavaScript when used on anumber.intas auintand sign-extend it to along. Whatever it is, though, there's probably a more natural, idiomatic way of doing in C# whatever it's intended to accomplish but we need to examine its purpose first.