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
Decimal.max(NaN, x) gives incorrect results when x is finite and long #48334
Comments
Here's a snippet from Python 2.6: >>> from decimal import Decimal, getcontext
>>> getcontext().prec = 3
>>> Decimal('NaN').max(Decimal('1234'))
Decimal('sNaN234') The result here should be Decimal('1.23E+3')---the specification says that This also affects min, max_mag and min_mag. The cause is that non-NaNs are incorrectly being passed to the _fix_nan It would be good to get this fix into 3.0, if possible. I think it should |
Unless Facundo or some of the other decimal contributors reviews and |
Commited in trunk and Py3, thanks Mark! Please, could you commit it in 2.5? The only change I've made in the After that, just close this. Thanks again! |
Mark, if you want to backport this, please go ahead. If want me to, |
Committed, r67699. Thanks! Leaving open because I still need to merge this to the 3.0 and 2.6 |
Merged to 2.6 and 3.0 maintenance branches (r67700, r67701). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: