Skip to content

Commit

Permalink
Fix #2 + #5 Make Python 3 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfischer-ch committed Jul 29, 2014
1 parent 97ce528 commit fa02807
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bitmath/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ def __div__(self, other):
return self._byte_value / float(other.bytes)

def __truediv__(self, other):
# TODO: Fix truediv for num / bm
# https://github.com/tbielawa/bitmath/issues/2
# num / bm
return self.__div__(other)

# def __floordiv__(self, other):
Expand Down Expand Up @@ -612,6 +611,10 @@ def __rdiv__(self, other):
# num / bm = num
return other / float(self.value)

def __rtruediv__(self, other):
# num / bm = num
return other / float(self.value)

"""Called to implement the built-in functions complex(), int(),
long(), and float(). Should return a value of the appropriate type.
Expand Down

0 comments on commit fa02807

Please sign in to comment.