Repository navigation
Conversation
This was referenced Oct 24, 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.
Ports the number-string half of compareExpressions#273 and #277 (
sig_figs/decimal_places) toexpression_parsing. The grading (sig_figs_match,decimal_places_match, the tolerances) and the feedback stay in compareExpressions.expression_parsing
read_written_number(string)returns aWrittenNumber(integer,fraction,has_point,exponent), orNoneifstringisn't exactly one decimal number..significant_figuresskips leading zeros. It counts trailing zeros only after a written point:540has 2,540.has 3, and92.00has 4..decimal_placessubtracts the exponent:5.02e4has 0, and5e-3has 3.is_number, because it reads what a learner wrote: a+sign, leading zeros and a trailing point are accepted. The exponent can be writtene,E,*10^or*10**; #273/#277 only reade/E.round_to_significant_figures(value, figures)returns a float.round_to_decimal_places(value, places)returns a string that keeps its trailing zeros.Verification
tests/test_written_number.pyis new), and so does the parity check.🤖 Generated with Claude Code