aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-11-17 01:16:42 +0800
committerGitHub <noreply@github.com>2019-11-17 01:16:42 +0800
commitd1b2ecec27ea17e42d504503c6d760ff3c67b9ad (patch)
treed83a95a4721336282be5d24b6d06c80fbaa9d5c6 /lib/compress.js
parent552be61c4d6756fb31675fee0b1284e23d5d8721 (diff)
downloadtracifyjs-d1b2ecec27ea17e42d504503c6d760ff3c67b9ad.tar.gz
tracifyjs-d1b2ecec27ea17e42d504503c6d760ff3c67b9ad.zip
refine precision limits on `unsafe_math` (#3589)
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index f82a165e..9366091c 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -2953,7 +2953,8 @@ merge(Compressor.prototype, {
&& typeof result == "number"
&& (this.operator == "+" || this.operator == "-")) {
var digits = Math.max(0, decimals(left), decimals(right));
- if (digits < 21) return +result.toFixed(digits);
+ // 53-bit significand => 15.95 decimal places
+ if (digits < 16) return +result.toFixed(digits);
}
return result;