Open
Conversation
- 음수 정수(-1, -2 등) 입력 시 소수 부분이 1로 반환되던 버그 수정 🐛 - returnVal이 0일 때 불필요한 '1 - 0' 연산 방지 조건 추가 ✅ - 기존 음수 소수(-1.7 → 0.7) 동작은 유지 🔧
kimorkim
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 문제 상황 (Problem)
현상:
( )의 소수 부분블록에서 음수 정수(예:-1,-2)를 입력하면 소수 부분이0이 아닌1로 반환됨원인:
-1입력 시:BigNumber(-1).minus(Math.floor(-1))→-1 - (-1)→0value < 0조건에 의해1 - 0→1이 반환됨 (정수인데 소수 부분이 1)✅ 해결 방안 (Solution)
1.
returnVal !== 0조건 추가1 - returnVal)이returnVal이 0이 아닌 경우에만 실행되도록 조건 추가if (value < 0)→if (value < 0 && returnVal !== 0)2. 기존 동작 유지
-11❌0✅-21❌0✅-1.70.70.7(변경 없음)3.140.140.14(변경 없음)000(변경 없음)🎯 예상 영향 범위 (Impact)
block_calc.js의calc_operation블록 중unnatural(소수 부분) 연산에만 영향📋 관련 이슈 (Related Issues)