From a0e9bf098ab5116c7f44a441c2957dc150391c79 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Wed, 8 Jul 2020 09:50:29 +0530 Subject: [PATCH 1/5] bpo-41205: Document Decimal power 0 to the 0 --- Doc/library/decimal.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index 38ad04177c5e89..1fda02e4338801 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1355,7 +1355,11 @@ In addition to the three supplied contexts, new contexts can be created with the must be integral. The result will be inexact unless ``y`` is integral and the result is finite and can be expressed exactly in 'precision' digits. The rounding mode of the context is used. Results are always correctly-rounded - in the Python version. + in the Python version. Also note that ``Decimal(0) ** Decimal(0)`` results in + ``InvalidOperation``, and if ``InvalidOperation`` is not trapped, then results in + ``Decimal('NaN')``. + + .. versionchanged:: 3.3 The C module computes :meth:`power` in terms of the correctly-rounded From 53898f93935f1e53850b16998d5f426672d9d765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Srinivas=20Reddy=20Thatiparthy=20=28=E0=B0=B6=E0=B1=8D?= =?UTF-8?q?=E0=B0=B0=E0=B1=80=E0=B0=A8=E0=B0=BF=E0=B0=B5=E0=B0=BE=E0=B0=B8?= =?UTF-8?q?=E0=B1=8D=20=20=E0=B0=B0=E0=B1=86=E0=B0=A1=E0=B1=8D=E0=B0=A1?= =?UTF-8?q?=E0=B0=BF=20=E0=B0=A4=E0=B0=BE=E0=B0=9F=E0=B0=BF=E0=B0=AA?= =?UTF-8?q?=E0=B0=B0=E0=B1=8D=E0=B0=A4=E0=B0=BF=29?= Date: Wed, 8 Jul 2020 22:07:24 +0530 Subject: [PATCH 2/5] Update Doc/library/decimal.rst Co-authored-by: Mark Dickinson --- Doc/library/decimal.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index 1fda02e4338801..40f2161d693598 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1355,7 +1355,7 @@ In addition to the three supplied contexts, new contexts can be created with the must be integral. The result will be inexact unless ``y`` is integral and the result is finite and can be expressed exactly in 'precision' digits. The rounding mode of the context is used. Results are always correctly-rounded - in the Python version. Also note that ``Decimal(0) ** Decimal(0)`` results in + in the Python version. ``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if ``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``. From 7c2cbd019abd497f916efcda2d13d2944ab400d0 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Wed, 8 Jul 2020 22:11:32 +0530 Subject: [PATCH 3/5] bpo-41205 rm blank line --- Doc/library/decimal.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index 40f2161d693598..84bf77f80c7db8 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1360,7 +1360,6 @@ In addition to the three supplied contexts, new contexts can be created with the ``Decimal('NaN')``. - .. versionchanged:: 3.3 The C module computes :meth:`power` in terms of the correctly-rounded :meth:`exp` and :meth:`ln` functions. The result is well-defined but From 57e14af818be0374b0f929a70fa8d2d5e0479bcb Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Wed, 8 Jul 2020 23:06:03 +0530 Subject: [PATCH 4/5] bpo-41205: Rm another line --- Doc/library/decimal.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index 84bf77f80c7db8..b1fabb26f0d5d0 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1359,7 +1359,6 @@ In addition to the three supplied contexts, new contexts can be created with the ``InvalidOperation``, and if ``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``. - .. versionchanged:: 3.3 The C module computes :meth:`power` in terms of the correctly-rounded :meth:`exp` and :meth:`ln` functions. The result is well-defined but From 4489ce53c085559a532db581a5cf5f693537bbf1 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Mon, 13 Jul 2020 09:20:17 +0530 Subject: [PATCH 5/5] bpo-41205: Add extra line --- Doc/library/decimal.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index b1fabb26f0d5d0..e194649e30d85c 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1355,9 +1355,10 @@ In addition to the three supplied contexts, new contexts can be created with the must be integral. The result will be inexact unless ``y`` is integral and the result is finite and can be expressed exactly in 'precision' digits. The rounding mode of the context is used. Results are always correctly-rounded - in the Python version. ``Decimal(0) ** Decimal(0)`` results in - ``InvalidOperation``, and if ``InvalidOperation`` is not trapped, then results in - ``Decimal('NaN')``. + in the Python version. + + ``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if ``InvalidOperation`` + is not trapped, then results in ``Decimal('NaN')``. .. versionchanged:: 3.3 The C module computes :meth:`power` in terms of the correctly-rounded