DRAFT: inline formatting of floating points#156671
Draft
pascaldekloe wants to merge 8 commits into
Draft
Conversation
* Fallback from Grisu to Dragon in flt2dec front * Together with name change to ensure all use checked * Drop of Grisu benchmarks which tested Dragon fallback * Documentation at functions instead of module level The values dropped in the benchmarks of Grisu are still covered in the Dragon benchmarks. All use of the format functions shows in this patch due to the name change. This ensures we don't leave any code behind which still uses strategy directly by accident.
"A little copying is better than a little dependency." — Rob Pike * Equivalence comparison explicit instead of generic * Bit patterns specified as ops::Range constants * No panic on invalid UTF-8 in equivalence test
* Test functionality as provided instead of inners * No generics abstraction of Grisu and Dragon * The stringify! of input in assertion message * TestableFloat abstraction omitted with macro * MSVC omission central, direct on respective test Unified signature plus description on assertion tools: * check_shortest! -> check_short! * try_exact! -> check_fixed_buf_match! * try_fixed! -> check_fixed_resolution! * check_exact & check_exact! -> check_fixed_mix! * check_exact_one -> check_coef_pow2!
Both the current and the correct value are equivalent when rounded to three decimals.
Collaborator
Collaborator
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
The represenation of NaN, Inf and zero each is fully dependend on the formatter. Differences are easy to see when the classify switch appears directly in the fmt function. Using the standard functions of each floating-point directly releases the need for trait abstractions.
598d060 to
f7f1cf0
Compare
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot)For more information how to resolve CI failures of this job, visit this link. |
Contributor
|
(marked as draft since the title says draft 🙂 ) |
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.
This is a followup of #154505.
The
flt2dec::Signenumeration got eliminated. I'm struggling on how to get of rid oftests/mir-opt/funky_arms.*which uses the type. Some pointers would be appreciated. 🙏