fix Math_floor coercion in unrecommended codegen modes (no roundings correction or imprecise i64)

This commit is contained in:
Alon Zakai 2014-01-15 14:19:01 -08:00
Родитель 0c4c790344
Коммит 54331941bf
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -2150,9 +2150,9 @@ function makeRounding(value, bits, signed, floatConversion) {
} }
} }
// Math.floor is reasonably fast if we don't care about corrections (and even correct if unsigned) // Math.floor is reasonably fast if we don't care about corrections (and even correct if unsigned)
if (!correctRoundings() || !signed) return 'Math_floor(' + value + ')'; if (!correctRoundings() || !signed) return '(+Math_floor(' + value + '))';
// We are left with >32 bits // We are left with >32 bits
return makeInlineCalculation(makeComparison('VALUE', '>=', '0', 'float') + ' ? Math_floor(VALUE) : Math_ceil(VALUE)', value, 'tempBigIntR'); return makeInlineCalculation(makeComparison('VALUE', '>=', '0', 'float') + ' ? +Math_floor(VALUE) : +Math_ceil(VALUE)', value, 'tempBigIntR');
} }
} }