[issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1)

Stefan Krah report at bugs.python.org
Sat Jul 4 05:22:30 EDT 2020


Stefan Krah <stefan at bytereef.org> added the comment:

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
context:

   1) context.create_decimal() ==> special case for NaN payloads.

   2) context.apply() (private method) ==> no special cases at all.

   3) Decimal.plus() ==> ROUND_FLOOR special case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41205>
_______________________________________


More information about the Python-bugs-list mailing list