aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-05-19 18:20:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-05-19 18:20:50 -0700
commit95022360758d466485157c21bdda1c9ec1aaf97d (patch)
tree7c4793ead1c1c25510b850ac931b01ee80a35c2e /src
parentdaaace05234c1da7969daf66ecfd96c89abd0ce3 (diff)
safety parentheses in makeRounding
Diffstat (limited to 'src')
-rw-r--r--src/parseTools.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index af85d569..774293d0 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -878,7 +878,7 @@ function makeSignOp(value, type, op) { // TODO: If value isNumber, do this at co
function makeRounding(value, bits, signed) {
// C rounds to 0 (-5.5 to -5, +5.5 to 5), while JS has no direct way to do that.
// With 32 bits and less, and a signed value, |0 will round it like C does.
- if (bits && bits <= 32 && signed) return '('+value+'|0)';
+ if (bits && bits <= 32 && signed) return '(('+value+')|0)';
// If the value may be negative, and we care about proper rounding, then use a slow but correct function
if (signed && correctRoundings()) return 'cRound(' + value + ')';
// Either this must be positive, so Math.Floor is correct, or we don't care