8000 bpo-41205: Document Decimal power 0 to the 0 (GH-21386) · python/cpython@10e4664 · GitHub
[go: up one dir, main page]

Skip to content

Commit 10e4664

Browse files
bpo-41205: Document Decimal power 0 to the 0 (GH-21386)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
1 parent 6bf3237 commit 10e4664

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/decimal.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,9 @@ In addition to the three supplied contexts, new contexts can be created with the
13571357
The rounding mode of the context is used. Results are always correctly-rounded
13581358
in the Python version.
13591359

1360+
``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if ``InvalidOperation``
1361+
is not trapped, then results in ``Decimal('NaN')``.
1362+
13601363
.. versionchanged:: 3.3
13611364
The C module computes :meth:`power` in terms of the correctly-rounded
13621365
:meth:`exp` and :meth:`ln` functions. The result is well-defined but

0 commit comments

Comments
 (0)
0