GoogleChromeLabs / jsbi

JSBI is a pure-JavaScript implementation of the official ECMAScript BigInt proposal.
https://v8.dev/features/bigint#polyfilling-transpiling
Apache License 2.0
919 stars 68 forks source link

(-(2n**64n - 1n)) >> 32n #57

Closed Yaffle closed 3 years ago

Yaffle commented 3 years ago

JSBI.signedRightShift(JSBI.unaryMinus(JSBI.subtract(JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(64)), JSBI.BigInt(1))), JSBI.BigInt(32)).toString() gives "0" which is wrong, seems

jakobkummerow commented 3 years ago

Confirmed; JSBI is missing the equivalent of https://chromium-review.googlesource.com/c/v8/v8/+/2561618.

Fix: https://github.com/GoogleChromeLabs/jsbi/pull/58