Message372969
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. |
|
Date |
User |
Action |
Args |
2020-07-03 22:51:25 | JD-Veiga | set | recipients:
+ JD-Veiga, docs@python |
2020-07-03 22:51:25 | JD-Veiga | set | messageid: <1593816685.46.0.773129097137.issue41205@roundup.psfhosted.org> |
2020-07-03 22:51:25 | JD-Veiga | link | issue41205 messages |
2020-07-03 22:51:25 | JD-Veiga | create | |
|