blob: 50b295aec463db418ac73fd93c04ed63dc2d0678 (
plain)
1
2
3
4
5
6
|
load(libdir + "asserts.js");
assertEq(BigInt.asUintN(32, -1n), 0xffffffffn);
assertThrowsInstanceOf(() => BigInt.asUintN(2**32 - 1, -1n), RangeError);
assertThrowsInstanceOf(() => BigInt.asUintN(2**32, -1n), RangeError);
assertThrowsInstanceOf(() => BigInt.asUintN(2**53 - 1, -1n), RangeError);
|