I know that JS Number
types are IEEE754 double precision floating points.
Given this fact, how does JS perform bitwise operations?
-1 >>> 1
=> 2147483647
Is it merely simulating bitwise operations programmatically or does the language actually have a special treatment for bitwise operations, like when using bitwise, load numbers on registers as Int32
bit pattern, etc.?
I'm not nit picky about performance, but given that bitwise operations are known to be efficient and often used for that reason, I'm wondering about the internals here.