Issue #12079: Decimal(0).fma(Decimal('inf'), 'not a number') should give a TypeError, not a Decimal.InvalidOperation

This commit is contained in:
Mark Dickinson 2011-05-22 12:53:18 +01:00
parent 203bdb3028
commit b455e58b95
3 changed files with 16 additions and 1 deletions

View file

@ -1871,6 +1871,7 @@ class Decimal(object):
"""
other = _convert_other(other, raiseit=True)
third = _convert_other(third, raiseit=True)
# compute product; raise InvalidOperation if either operand is
# a signaling NaN or if the product is zero times infinity.
@ -1900,7 +1901,6 @@ class Decimal(object):
str(int(self._int) * int(other._int)),
self._exp + other._exp)
third = _convert_other(third, raiseit=True)
return product.__add__(third, context)
def _power_modulo(self, other, modulo, context=None):