Add -f for Fraction

This commit is contained in:
lafrite 2014-01-17 18:10:38 +01:00
parent 8a41031fa8
commit 999fde1c51

View File

@ -126,6 +126,9 @@ class Fraction(object):
steps += ans_frac.simplify() steps += ans_frac.simplify()
return steps return steps
def __neg__(self):
return [Fraction(-self._num,self._denom)]
def __mul__(self, other): def __mul__(self, other):
if type(other) == Fraction: if type(other) == Fraction: