Skip to content

Commit

Permalink
Bug in multiplication with compile-time float.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Aug 8, 2020
1 parent 1871ed7 commit cf1719b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Compiler/GC/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def __mul__(self, other):
__rxor__ = __xor__
__rmul__ = __mul__
@staticmethod
def multipliable(other, k, f):
def multipliable(other, k, f, size):
class cls(_fix):
int_type = sbitint.get_type(k)
cls.set_precision(f, k)
Expand Down
6 changes: 3 additions & 3 deletions Compiler/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3250,7 +3250,7 @@ def mul(self, other):
f -= 1
v //= 2
k = len(bin(abs(v))) - 1
other = self.multipliable(v, k, f)
other = self.multipliable(v, k, f, self.size)
try:
other = self.coerce(other)
except:
Expand Down Expand Up @@ -3372,8 +3372,8 @@ def unreduced(self, v, other=None, res_params=None, n_summands=1):
return unreduced_sfix(v, self.k * 2, self.f, self.kappa)

@staticmethod
def multipliable(v, k, f):
return cfix(cint.conv(v), k, f)
def multipliable(v, k, f, size):
return cfix(cint.conv(v, size=size), k, f)

def reveal_to(self, player):
""" Reveal secret value to :py:obj:`player`.
Expand Down

0 comments on commit cf1719b

Please sign in to comment.