Repository navigation
InputForm of a low-precision number shows the digits it keeps, as in WMA - #2064
Merged
Merged
Conversation
…s, as in WMA Since #2060 a PrecisionReal with fewer than 64 bits of precision keeps its value with 64 bits (``_extended``), but InputForm and FullForm printed only the digits that the precision gives, so the printed form did not read back as the same number. As in WMA, InputForm and FullForm now print the shortest decimal string that reads back as the kept value; OutputForm and StandardForm still print the digits of the precision. WMA 15: InputForm[3.1415926535897932385`3] -> 3.1415926535897932385`3. InputForm[-4.326563712`2] -> -4.326563712`2. InputForm[-4.32`4] -> -4.32`4. (the last two are in test/format/format_tests-WMA.yaml; the Mathics expectation for -4.326563712`2 in format_tests.yaml is updated to match). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…how the kept digits These forms go through InputForm too, so they now show the digits that the number keeps, as the text form does; WMA's MathML InputForm also shows -4.326563712 (test/format/format_tests-WMA.yaml). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
LGTM |
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.
Since #2060 a PrecisionReal with fewer than 64 bits of precision keeps its
value with 64 bits (
_extended), but InputForm and FullForm printed onlythe digits that the precision gives, so the printed form did not read back
as the same number.
As in WMA, InputForm and FullForm now print the shortest decimal string that
reads back as the kept value; OutputForm and StandardForm still print the
digits of the precision. WMA 15:
(the last two are in test/format/format_tests-WMA.yaml; the Mathics
expectation for -4.326563712`2 in format_tests.yaml is updated to match).
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
🤖 Generated with Claude Code