[removed] Bitwise shift of long long number

前端 未结 2 710
后悔当初
后悔当初 2020-11-28 10:24

I need to bitwise shift a value 64 times in JavaScript. But JavaScript starts rounding after 32.

For example:

for(var j = 0; j < 64;          


        
2条回答
  •  粉色の甜心
    2020-11-28 10:42

    JavaScript stores all its numbers as 64 bit initally, but as soon as you start using bitwise operators the interpreter converts the number to a 32 bit representation..

    Bitwise operators are a bit hacky in JS and so annoyingly you will probably have to do something a bit more clever, like write your own 64 bit functions.

提交回复
热议问题