I need to set 50th bit of a number. But bitwise operators work in javascript only on lower 32 bits. So I my solution is:
function set50thBitOf(x) {
hi=Math.trunc(x/2**32);
lo=x%2**32;
res=(hi|2**(50-32-1))*2**32+lo;
return res;
}
Is there better way?