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
6 changes: 6 additions & 0 deletions Doc/library/decimal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,12 @@ Decimal objects

>>> Decimal(2).fma(3, 5)
Decimal('11')
>>> with localcontext(ExtendedContext):
... a, b, c = map(Decimal, ['888565290', '1557.96930',
... '-86087.7578'])
... a.fma(b, c), a*b + c
...
(Decimal('1.38435736E+12'), Decimal('1.38435735E+12'))

.. method:: is_canonical()

Expand Down
8 changes: 7 additions & 1 deletion Modules/_decimal/_decimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4945,12 +4945,18 @@ self*other.

>>> Decimal(2).fma(3, 5)
Decimal('11')
>>> with localcontext(ExtendedContext):
... a, b, c = map(Decimal, ['888565290', '1557.96930',
... '-86087.7578'])
... a.fma(b, c), a*b + c
...
(Decimal('1.38435736E+12'), Decimal('1.38435735E+12'))
[clinic start generated code]*/

static PyObject *
_decimal_Decimal_fma_impl(PyObject *self, PyTypeObject *cls, PyObject *other,
PyObject *third, PyObject *context)
/*[clinic end generated code: output=db49a777e85b71e4 input=2104c001f6077c35]*/
/*[clinic end generated code: output=db49a777e85b71e4 input=cf13278e863e8269]*/
Dec_TernaryFuncVA(mpd_qfma)

/* Boolean functions, no context arg */
Expand Down
10 changes: 8 additions & 2 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