As I understand it, JS treats numbers as 32 bits when performing bit-shift operations, even though it supports 64-bit numbers.
How can I implement a function leftShiftthat works on 64-bit numbers? those. it will not turn into negatives for something like 192 << 24(it should be 3221225472, not -1073741824).
leftShift
192 << 24
3221225472
-1073741824
Just do what math left shift :
() (), (, 2 ).
function shift(number, shift) { return number * Math.pow(2, shift); } shift(192, 24) //3221225472 shift(3221225472, -24) //192
Source: https://habr.com/ru/post/1611690/More articles:Passing code as an argument (C ++) - c ++Using Avrocoder for custom types using wagons - google-cloud-platformFinding a union how to configure the UDF insert function wizards and force UDF to manipulate other cells - debuggingCan the Apache Avro framework handle parameterized types during serialization? - javaДолжен ли я закрывать поток при повторном использовании FileOutputStream? - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1611691/robot-framework-using-relative-paths-to-run-tests-from-different-directory-variations&usg=ALkJrhiPGgqlvWjq5CBSJBgZSJybWSBb0QUsing the Facebook Graph API, you can determine if a page / page will be promoted / sponsored? - facebookComparison of difficulty values with oncoming - javaThe title bar is displayed in the middle of the page during screenshots on Selenium - pythonCloudfront and EC2 - amazon-web-servicesAll Articles