|
|
|
|
|
by dahfizz
1545 days ago
|
|
> It requires only additions, subtractions and bit shifts: 2x is the same as x<<1, of course. It also requires only integer arithmetic. Does any of this mean anything in JS, where AFAIK there are no real ints? 2x is an fpu operation under the hood, and not a bit shift. |
|
For bitwise operations, JavaScript will first convert the number to a 32-bit two's complement signed integer.