Browse Source

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionOperation

TonyKang 7 years ago
parent
commit
788cc584d6
1 changed files with 7 additions and 0 deletions
  1. 7 0
      public/web/scMathUtil.js

+ 7 - 0
public/web/scMathUtil.js

@@ -60,7 +60,14 @@ let scMathUtil = {
         let result = bin;
         let iDot = bin.indexOf('.');
         if (iDot < 0){return result};
+        // 二进制浮点数带小数位数最大长度
+        let floatLength = 53;
         let iLength = bin.length;
+        // 长度小于53说明该二进制数尾数长度小于Double类型限制,未被截断,无需进位
+        if (iLength < floatLength) {
+            return result;
+        }
+        iLength = bin.length;
         for (let i = iLength - 1; i > iDot; i--){
             let num = Number(bin[i]);
             if (num === 0){