mask |= (1 << bit);
clear a bit like this:
mask &= ~(1 << bit);
and check if a bit is set like this:
(bit & mask) != 0
- 32 bits, as bit operations may be undefined past 32 bits
- 53 bits, as
2^53 - 1
Which one is correct? Or is it something else?
126.96.36.199.9 Number::leftShift ( x, y )
- Let lnum be ! ToInt32(x).
- Let rnum be ! ToUint32(y).
- Let shiftCount be the result of masking out all but the least significant 5 bits of rnum, that is, compute rnum & 0x1F.
- Return the result of left shifting lnum by shiftCount bits. The result is a signed 32-bit integer.