Skip to content

Other fix 858#860

Closed
javierelpianista wants to merge 6 commits intompmath:masterfrom
javierelpianista:other-fix-858
Closed

Other fix 858#860
javierelpianista wants to merge 6 commits intompmath:masterfrom
javierelpianista:other-fix-858

Conversation

@javierelpianista
Copy link
Copy Markdown
Contributor

This PR improves upon the fixes in #859 for fixed formatting of numbers like 0.99, 0.999, etc.

skirpichev and others added 6 commits September 1, 2024 14:47
Fix also few other minor issues, coming from tests.

Closes mpmath#858
Should be useful for formatting complex numbers
* Move the 'hack' to round_digits
* Improve code to better detect when to add an extra decimal 0 to acommodate
for the required precision
return sign, digits, exponent

def round_digits(sign, digits, dps, base, rounding=round_nearest):
def round_digits(sign, digits, dps, base, rounding=round_nearest, fixed=False):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be the key. Now I think that the fix should go to "Rounding up kills some instances" block and could be one-liner.

@skirpichev
Copy link
Copy Markdown
Collaborator

#859 merged with fix from this pr.

@skirpichev skirpichev closed this Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants