This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jayanthkoushik
Recipients docs@python, jayanthkoushik
Date 2014-05-15.05:19:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The documentation for decimal.fma provides an example which fails to illustrate the most important feature of the function i.e. single rounding. In fact:

    Decimal(2).fma(3, 5) == Decimal(2)*3 + 5

An example such as this would make it much more clear:

    >>> getcontext().prec = 2
    >>> getcontext().rounding = ROUND_DOWN
    >>> Decimal('1.5')*Decimal('1.5') + Decimal('1.05')
    >>> Decimal('1.5').fma(Decimal('1.5'), Decimal('1.05'))
Date User Action Args
2014-05-15 05:19:05jayanthkoushiksetrecipients: + jayanthkoushik, docs@python
2014-05-15 05:19:05jayanthkoushiksetmessageid: <>
2014-05-15 05:19:05jayanthkoushiklinkissue21510 messages
2014-05-15 05:19:05jayanthkoushikcreate