소스 검색

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 = {