>>>
- bitwise operator "zero filling right shift" .
JavaScript numbers can represent both integers and floating point numbers. Sometimes you only need an integer. Any positive JavaScript number representing a number less than 2 ^ 32 will be rounded (truncated, as in Math.floor
) to the nearest integer. Numbers β₯ 2 ^ 32 are rotated by 0. A number less than 0 will turn into a positive value (thanks to the magic of representing two additions).
However, this.length
supposed to ALWAYS be an integer less than 2 ^ 32 ... so I cannot explain why the code will do this. The result should be the same as this.length
.
source share