Skip to content

Fix formatting of mpf's when format type is missing#857

Merged
skirpichev merged 1 commit intompmath:masterfrom
skirpichev:fix-empty-format-856
Sep 8, 2024
Merged

Fix formatting of mpf's when format type is missing#857
skirpichev merged 1 commit intompmath:masterfrom
skirpichev:fix-empty-format-856

Conversation

@skirpichev
Copy link
Copy Markdown
Collaborator

@skirpichev skirpichev commented Aug 31, 2024

In this case it was incorrectly assumed, that this is an equivalent of 'g' formatting type. It's not:

  1. when no precision is specified - it should be equal to repr_deps(prec) to represent the given value faithfully.
  2. when fixed-point is used to format the result, it always includes at least one digit past the decimal point.

Closes #856

@skirpichev
Copy link
Copy Markdown
Collaborator Author

Now on top of #859

@skirpichev skirpichev force-pushed the fix-empty-format-856 branch 2 times, most recently from 3a1a50a to 7e8c49b Compare September 6, 2024 12:33
@skirpichev skirpichev marked this pull request as ready for review September 7, 2024 00:40
@skirpichev
Copy link
Copy Markdown
Collaborator Author

See also python/cpython#123560

In this case it was incorrectly assumed, that this is an equivalent of
'g' formatting type.  It's not:
1) when no precision is specified - it should be equal to
   repr_deps(prec) to represent the given value faithfully.
2) when fixed-point is used to format the result, it always includes at
   least one digit past the decimal point.

Closes mpmath#856
@skirpichev skirpichev merged commit b4b3b9c into mpmath:master Sep 8, 2024
@skirpichev skirpichev deleted the fix-empty-format-856 branch September 8, 2024 03:33
@skirpichev skirpichev added this to the 1.4 milestone May 9, 2025
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.

Formatting mpf's is incompatible with Python if formatting type is missing

1 participant