-
Notifications
You must be signed in to change notification settings - Fork 194
Add documentation for mpf.__format__
#850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
The method is only implemented for the _mpf type, and it follows the same conventions as in https://docs.python.org/3/library/string.html#formatstrings, but extended to mpf floats. Also added tests to this function.
…haracters after type specification
… test case for when both 0-padding and fill char are selected.
The 'z' feature was included in Python 3.11, so it makes no sense to test for it if we are using an older Python version.
* change imports * move helper up * spaces
* unident some code * kill some comments * move up _FLOAT_FORMAT_SPECIFICATION_MATCHER
* Added this functionality to format_scientific and format_fixed functions * Added random tests for very small numbers to test_format.py
* Added 10 digits to the calls to to_digits_exp, this fixes wrong formatting for some subnormal floats. * Also removed code for no_neg_0 checking in format_scientific, since it was never called.
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
skirpichev
approved these changes
Aug 27, 2024
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 did few edits, now LGTM
Are you ok with changes or want to add something?
I think it's better with your changes. I can't think of anything I'd like to add right now. |
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.
Adds a bit of documentation in the Utility Functions section.
Closes #337