mirror of https://github.com/tc39/test262.git
26 lines
492 B
JavaScript
26 lines
492 B
JavaScript
//@ runBigIntEnabled
|
|
|
|
let assert = {
|
|
sameValue: function(i, e, m) {
|
|
if (i !== e)
|
|
throw new Error(m);
|
|
}
|
|
}
|
|
|
|
function bigIntMul(x, y) {
|
|
return x * y;
|
|
}
|
|
noInline(bigIntMul);
|
|
|
|
for (let i = 0; i < 10000; i++) {
|
|
let r = bigIntMul(3n, 10n);
|
|
assert.sameValue(r, 30n, 3n + " * " + 10n + " = " + r);
|
|
}
|
|
|
|
let r = bigIntMul(3, 10);
|
|
assert.sameValue(r, 30, 3 + " * " + 10 + " = " + r);
|
|
|
|
r = bigIntMul("3", "10");
|
|
assert.sameValue(r, 30, 3 + " * " + 10 + " = " + r);
|
|
|