Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Lib/_pydecimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5155,8 +5155,8 @@ def number_class(self, a):
"""Returns an indication of the class of the operand.

The class is one of the following strings:
-sNaN
-NaN
sNaN
NaN
-Infinity
-Normal
-Subnormal
Expand Down Expand Up @@ -5665,8 +5665,9 @@ def to_integral_value(self, a):
When the operand has a negative exponent, the result is the same
as using the quantize() operation using the given operand as the
left-hand-operand, 1E+0 as the right-hand-operand, and the precision
of the operand as the precision setting, except that no flags will
be set. The rounding mode is taken from the context.
of the operand as the precision setting, except that the Inexact and
Rounded flags will not be set. The rounding mode is taken from the
context.

>>> ExtendedContext.to_integral_value(Decimal('2.1'))
Decimal('2')
Expand Down
10 changes: 8 additions & 2 deletions Modules/_decimal/docstrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,13 @@ Return the sum of x and y.\n\

PyDoc_STRVAR(doc_ctx_canonical,
"canonical($self, x, /)\n--\n\n\
Return a new instance of x.\n\
Returns the same Decimal object.\n\
\n\
As we do not have different encodings for the same number, the\n\
received object already is in its canonical form.\n\
\n\
>>> ExtendedContext.canonical(Decimal('2.50'))\n\
Decimal('2.50')\n\
\n");

PyDoc_STRVAR(doc_ctx_compare,
Expand Down Expand Up @@ -867,7 +873,7 @@ the context to the result.\n\
PyDoc_STRVAR(doc_ctx_power,
"power($self, /, a, b, modulo=None)\n--\n\n\
Compute a**b. If 'a' is negative, then 'b' must be integral. The result\n\
will be inexact unless 'a' is integral and the result is finite and can\n\
will be inexact unless 'b' is integral and the result is finite and can\n\
be expressed exactly in 'precision' digits. In the Python version the\n\
result is always correctly rounded, in the C version the result is almost\n\
always correctly rounded.\n\
Expand Down
Loading