13 lines
390 B
JavaScript
13 lines
390 B
JavaScript
function mathRoundDoesNotCareAboutMinusZero(value)
|
|
{
|
|
return Math.round(value);
|
|
}
|
|
noInline(mathRoundDoesNotCareAboutMinusZero);
|
|
|
|
for (var i = 0; i < 1e4; ++i) {
|
|
var doubleMid = -9901 - 0.6;
|
|
var roundedValue = mathRoundDoesNotCareAboutMinusZero(doubleMid);
|
|
if (roundedValue !== -9902)
|
|
throw "mathRoundDoesNotCareAboutMinusZero(" + doubleMid + ") = " + roundedValue;
|
|
}
|