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
Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1) #85377
Comments
Hi, I would like to propose a minor addition to Indeed, However, I think that this is not enough to indicate the different behaviour of decimal versus int and float numbers. Moreover, in the case of Thank you and sorry for the inconvenience. |
Huh! I thought everyone in Standards World gave up by now, and agreed 0**0 should be 1. |
Well, it is the way that it has been defined in |
I agree that the result is surprising and should be noted in the docs; we shouldn't expect all the decimal users to be familiar with the specification. Some of the other differences with float arithmetic are noted (e.g., the behaviour of The part that I find really odd is that the specification says that I'm not sure whether just noting this in the "power" documentation is enough: it's not clear to me that users using the ** operator would think to check the docs for the "power" method. The other weirdly non-IEEE 754 behaviour (again, mandated by the standard) that bugs me from time to time is that the unary |
Agreed, and it's even slightly worse with the ROUND_FLOOR special case: >>> c.rounding = ROUND_FLOOR
>>> +Decimal("-0")
Decimal('-0')
>>> That's why there are three slightly different methods for applying the
|
@JD-Veiga: would you be willing to work on a PR? |
Mark, do you think that we should document the other oddity as well |
@skrah Issue seems to be solved. We can close the issue. |
Closing. It doesn't seem worth documenting the |
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: