Add abs method for Fraction
This commit is contained in:
parent
8631cfd349
commit
f444a58a2b
@ -273,6 +273,9 @@ class Fraction(object):
|
||||
|
||||
return steps
|
||||
|
||||
def __abs__(self):
|
||||
return Fraction(abs(self._num), abs(self._denom))
|
||||
|
||||
def __eq__(self, other):
|
||||
""" == """
|
||||
if type(other) == Fraction:
|
||||
|
Loading…
Reference in New Issue
Block a user