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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to pass a precision? Otherwise the
BigFloat
constructor may use too low a precision.Why do we need a conversion at all here? Wouldn't it be possible to have
Printf.tofloat(x::DecimalFloatingPoint) = x
and support printing natively on decimal floating point values? It seems like a shame to do a lossy conversion to binary floating point for printing — kinda defeats the point.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also prefer to not go through BigFloat. In the original Printf PR, there is another interface mentioned where we could pass a buffer of digit chars and the location of the decimal point and have that formatted.
I would like to try that interface but I can't find it in the current code. JuliaLang/julia#32859 (comment) Is that interface implemented @quinnj ?