Skip to content

Commit

Permalink
Fix 'fix_precision' error
Browse files Browse the repository at this point in the history
  • Loading branch information
Endogen committed Sep 29, 2024
1 parent 9eeeace commit 0307430
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/contracting/stdlib/bridge/decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ def __rtruediv__(self, other):
return fix_precision(self._d.__rtruediv__(self._get_other(other)))

def __divmod__(self, other):
return fix_precision(self._d.__divmod__(self._get_other(other)))
q, r = self._d.__divmod__(self._get_other(other))
return (fix_precision(q), fix_precision(r))

def __rdivmod__(self, other):
return fix_precision(self._d.__divmod__(self._get_other(other)))
q, r = self._get_other(other).__divmod__(self._d)
return (fix_precision(q), fix_precision(r))

def __mod__(self, other):
return fix_precision(self._d.__mod__(self._get_other(other)))
Expand Down

0 comments on commit 0307430

Please sign in to comment.