mirror of https://github.com/tc39/test262.git
Add edge tests to verify BigInt to Number conversion when BigInt can't directly be represented by a Number.
This commit is contained in:
parent
5549fd0022
commit
1dc78879d4
|
@ -9,3 +9,15 @@ features: [BigInt]
|
|||
|
||||
assert.sameValue(Number(0n), 0);
|
||||
assert.sameValue(+(new Number(0n)), +(new Number(0)));
|
||||
|
||||
assert.sameValue(Number(2n**53n), 9007199254740992);
|
||||
assert.sameValue(Number(2n**53n + 1n), 9007199254740992);
|
||||
assert.sameValue(Number(2n**53n + 2n), 9007199254740994);
|
||||
assert.sameValue(Number(2n**53n + 3n), 9007199254740996);
|
||||
assert.sameValue(Number(2n**53n + 4n), 9007199254740996);
|
||||
|
||||
assert.sameValue(Number(-(2n**53n)), -9007199254740992);
|
||||
assert.sameValue(Number(-(2n**53n + 1n)), -9007199254740992);
|
||||
assert.sameValue(Number(-(2n**53n + 2n)), -9007199254740994);
|
||||
assert.sameValue(Number(-(2n**53n + 3n)), -9007199254740996);
|
||||
assert.sameValue(Number(-(2n**53n + 4n)), -9007199254740996);
|
||||
|
|
Loading…
Reference in New Issue