aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-15 14:19:01 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-15 14:19:55 -0800
commit54331941bfda2dca0a59224d7219fc12f93b1c15 (patch)
tree29dff66149e6b3171147809b3a2ee036542d5911 /src/parseTools.js
parent0c4c790344a1d0559689ec454d820c96a28fa204 (diff)
fix Math_floor coercion in unrecommended codegen modes (no roundings correction or imprecise i64)
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index b7f97a40..be0cbcab 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -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)
- if (!correctRoundings() || !signed) return 'Math_floor(' + value + ')';
+ if (!correctRoundings() || !signed) return '(+Math_floor(' + value + '))';
// 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');
}
}