This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JD-Veiga
Recipients JD-Veiga, docs@python
Date 2020-07-03.22:51:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593816685.46.0.773129097137.issue41205@roundup.psfhosted.org>
In-reply-to
Content
Hi,

I would like to propose a minor addition to `decimal` package documentation page (https://docs.python.org/3/library/decimal.html). I think that we should add a paragraph in `context.power(x, y, modulo=None)` stating that `Decimal(0) ** Decimal(0)` returns `Decimal('NaN')` instead of `1` --as `0 ** 0` does-- or `1.0` --in case of `0.0 ** 0.0`.

Indeed, `0 ** 0` is `NaN` is mentioned as example of operations raising `InvalidOperation` exceptions.

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 `%` and `//` operators, there are clear remarks on these differences (See: “There are some small differences between arithmetic on Decimal objects and arithmetic on integers and floats [...]” in the page).

Thank you and sorry for the inconvenience.
History
Date User Action Args
2020-07-03 22:51:25JD-Veigasetrecipients: + JD-Veiga, docs@python
2020-07-03 22:51:25JD-Veigasetmessageid: <1593816685.46.0.773129097137.issue41205@roundup.psfhosted.org>
2020-07-03 22:51:25JD-Veigalinkissue41205 messages
2020-07-03 22:51:25JD-Veigacreate