Conversation
변수 값이 1e+21 형태가 된 뒤 더하기 연산이 숫자 덧셈이 아닌 문자열 결합으로 처리되는 문제를 수정한다. 원인 - JS 는 |x| >= 1e21 부터 String(x) 와 Number.prototype.toFixed() 가 지수 표기를 반환한다. `변수에 O만큼 더하기`(block_variable.js)의 .toNumber().toFixed() 가 이 경계에서 "1e+21" 문자열을 만들어 변수에 저장한다. - Entry.Utils.isNumber 의 정규식이 지수 표기를 매치하지 않아, calc_basic 의 PLUS 분기가 parseFloat 로 이미 파싱된 값을 다시 문자열로 되돌린다. 같은 함수 안에서 parseFloat 와 isNumber 의 판정이 어긋나 있던 것이 문제의 실체다. 수정 범위 - utils.js 의 정규식 한 줄만 확장한다. false -> true 로 바뀌는 값은 지수 표기 문자열뿐이고 기존에 true 였던 값이 false 가 되는 경우는 없다(단조 확장). 한 글자 단위로 검사하는 입력 필터(textInput/angle) 에서도 'e' 단독은 여전히 매치되지 않아 동작이 변하지 않는다. - block_calc.js 와 block_variable.js 는 변경하지 않는다. block_variable 의 .toNumber() 를 제거하면 `변수에 더하기`와 `변수 정하기`의 표시가 갈리므로 표시 정책은 별도 과제로 분리한다. 동작 변경(QA 확인 필요) - `O이(가) 숫자인가?` 블록이 1e+21 에 참을 반환한다. - 지수 문자열을 담은 변수가 숫자 변수로 취급된다. - 파이썬 변환 시 지수 표기가 따옴표 없이 출력된다. 테스트 - test/util/isNumber.spec.js (48) 지수 표기 인정, 거부 대상 유지, 단조 확장, 한 글자 입력 필터 가드, parseNumber 프로젝트 로드 경로 - test/playground/blocks/calc_basic.spec.js (10) VOC 재현, toFixed 산출값 재계산, 글자 결합/소수점 오차/나머지 연산자 가드 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Tnks2U
approved these changes
Sep 1, 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.
변수 값이 1e+21 형태가 된 뒤 더하기 연산이 숫자 덧셈이 아닌 문자열
결합으로 처리되는 문제를 수정한다.
원인
변수에 O만큼 더하기(block_variable.js)의 .toNumber().toFixed() 가 이 경계에서 "1e+21" 문자열을 만들어 변수에 저장한다.수정 범위
변수에 더하기와변수 정하기의 표시가 갈리므로 표시 정책은 별도 과제로 분리한다.동작 변경(QA 확인 필요)
O이(가) 숫자인가?블록이 1e+21 에 참을 반환한다.테스트