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 @@ -5076,8 +5076,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 @@ -5586,8 +5586,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
12 changes: 6 additions & 6 deletions Modules/_decimal/_decimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,12 +940,12 @@ _decimal.Context.Etop
Return a value equal to Emax - prec + 1.

This is the maximum exponent if the _clamp field of the context is
set to 1 (IEEE clamp mode). Etop() must not be negative.
set to 1 (IEEE clamp mode).
[clinic start generated code]*/

static PyObject *
_decimal_Context_Etop_impl(PyObject *self)
/*[clinic end generated code: output=f0a3f6e1b829074e input=35b9defc69d5e5d1]*/
/*[clinic end generated code: output=f0a3f6e1b829074e input=a3e53bbf31ffd330]*/
{
return PyLong_FromSsize_t(mpd_etop(CTX(self)));
}
Expand Down Expand Up @@ -6785,7 +6785,7 @@ _decimal.Context.power
Compute a**b.

If 'a' is negative, then 'b' must be integral. The result will be
inexact unless 'a' is integral and the result is finite and can be
inexact unless 'b' is integral and the result is finite and can be
expressed exactly in 'precision' digits. In the Python version the
result is always correctly rounded, in the C version the result is
almost always correctly rounded.
Expand All @@ -6803,7 +6803,7 @@ restrictions hold:
static PyObject *
_decimal_Context_power_impl(PyObject *context, PyTypeObject *cls,
PyObject *base, PyObject *exp, PyObject *mod)
/*[clinic end generated code: output=d06d40c37cdd69dc input=178a254468ec189b]*/
/*[clinic end generated code: output=d06d40c37cdd69dc input=660210a6607ca4b0]*/
{
PyObject *a, *b, *c = NULL;
PyObject *result;
Expand Down Expand Up @@ -7063,13 +7063,13 @@ _decimal_Context_apply_impl(PyObject *context, PyTypeObject *cls,
/*[clinic input]
_decimal.Context.canonical = _decimal.Context.is_normal

Return a new instance of x.
Return x unchanged.
[clinic start generated code]*/

static PyObject *
_decimal_Context_canonical_impl(PyObject *context, PyTypeObject *cls,
PyObject *x)
/*[clinic end generated code: output=f213e433e2032e5e input=025ecb106ac15bff]*/
/*[clinic end generated code: output=f213e433e2032e5e input=f8fd49573263a2b6]*/
{
decimal_state *state = PyType_GetModuleState(cls);
if (!PyDec_Check(state, x)) {
Expand Down
8 changes: 4 additions & 4 deletions Modules/_decimal/clinic/_decimal.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading