瀏覽代碼

Update DecimalPlaceIsNonZero

Simplify formula used to get the desired place in the input.
ApisNecros 1 年之前
父節點
當前提交
882f309377
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      IntComp/common.js

+ 1 - 1
IntComp/common.js

@@ -25,7 +25,7 @@ function DeepClone(toClone) {
  * @returns {boolean} Whether the value in that number's place is non-zero
  */
 function DecimalPlaceIsNonZero(input, place) {
-    return !!Math.floor((input % (10 ** place)) / (10 ** (place - 1)));
+    return !!Math.floor((input / (10 ** place)) % 10);
 }
 
 module.exports = {