mirror of https://github.com/tc39/test262.git
13 lines
315 B
JavaScript
13 lines
315 B
JavaScript
function mathTrunc(value)
|
|
{
|
|
return Math.trunc(value);
|
|
}
|
|
noInline(mathTrunc);
|
|
|
|
for (var i = 0; i < 1e4; ++i) {
|
|
var doubleMid = -9901 - 0.6;
|
|
var roundedValue = mathTrunc(doubleMid);
|
|
if (roundedValue !== -9901)
|
|
throw "mathRoundDoesNotCareAboutMinusZero(" + doubleMid + ") = " + roundedValue;
|
|
}
|