Closed drom closed 4 years ago
In JavaScript the numbers wider than 32-bit can't be safely used with any bitwise operations.
JavaScript have BigInt type: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt
BigInt
NodeJS 10.7+ and NAPI also has support https://nodejs.org/api/n-api.html#n_api_napi_create_bigint_words
BigInt type has an appropriate set of bitwise operators and clamp methods: asUintN, asIntN
The latest version(v0.11.0 now makes all signals for width > 32 require BigInt)
In JavaScript the numbers wider than 32-bit can't be safely used with any bitwise operations.
JavaScript have
BigInt
type: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigIntNodeJS 10.7+ and NAPI also has support https://nodejs.org/api/n-api.html#n_api_napi_create_bigint_words
BigInt
type has an appropriate set of bitwise operators and clamp methods: asUintN, asIntN