Skip to content

Test new defaults for to_str()#832

Closed
skirpichev wants to merge 15 commits intompmath:masterfrom
skirpichev:test-to_str
Closed

Test new defaults for to_str()#832
skirpichev wants to merge 15 commits intompmath:masterfrom
skirpichev:test-to_str

Conversation

@skirpichev
Copy link
Collaborator

No description provided.

javierelpianista and others added 13 commits August 2, 2024 11:00
* Added new rounding mode: round_nearest_even: round to nearest tying to even.
* Modified round_digits to accomodate for this new mode.
* Wrote abs_rounding function.
* Replaced part of the code in to_str with a call to round_digits.
* Added tests for different kinds of rounding in test_convert.py
* Add new symbol, 'M', for rounding to nearest with tying away from zero.
* Replaced part of the code in format_mpf with a call to abs_rounding
* Added tests for the M rounding mode.
* Add new symbol, 'Y', for rounding away from zero.
* Added tests for the Y rounding mode.
* The default for the rounding parameter is None.
* If rounding is None, a DeprecationWarning is raised; the rounding part of the code executes legacy code
* Else, the new round_digits function is called
* Made all the dunder methods that call to_str to include the rounding
parameter obtained from context. This is to avoid the new deprecation warning
in to_str.
Modified the call to to_str in mpc_to_str to include the rounding parameter
taken from context.
@skirpichev
Copy link
Collaborator Author

Successful for the Diofant.

@skirpichev skirpichev closed this Aug 6, 2024
@skirpichev skirpichev deleted the test-to_str branch August 6, 2024 06:17
@skirpichev skirpichev restored the test-to_str branch August 11, 2024 04:44
@skirpichev skirpichev deleted the test-to_str branch September 8, 2024 04:39
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