diff --git a/pyRCV2/numbers/fixed_py.py b/pyRCV2/numbers/fixed_py.py index 29c9709..c3a0ea0 100644 --- a/pyRCV2/numbers/fixed_py.py +++ b/pyRCV2/numbers/fixed_py.py @@ -46,6 +46,17 @@ class Fixed(BasePyNum): """Overrides BasePyNum._to_impl""" return decimal.Decimal(value).quantize(_quantize_exp) + @classmethod + def _truediv_impl(cls, i1, i2): + """Implements BaseNum._truediv_impl""" + return (i1 / i2).quantize(_quantize_exp) + + @compatible_types + def __itruediv__(self, other): + """Overrides BaseNum.__itruediv__""" + self.impl = (self.impl / other.impl).quantize(_quantize_exp) + return self + def round(self, dps, mode): """Implements BaseNum.round""" return Fixed._from_impl(self.impl.quantize(decimal.Decimal('10') ** -dps, mode))