Skip to content

Commit a0c642d

Browse files
committed
Fix bug in fixed-point addition with binary circuits.
1 parent bc99d71 commit a0c642d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Compiler/types.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4704,7 +4704,7 @@ def set_precision_from_args(cls, program, adapt_ring=False):
47044704

47054705
@classmethod
47064706
def coerce(cls, other, equal_precision=None):
4707-
if isinstance(other, (_fix, cls.clear_type)):
4707+
if isinstance(other, (_fix, cls.clear_type, _vectorizable)):
47084708
return other
47094709
else:
47104710
return cls.conv(other)
@@ -4789,6 +4789,9 @@ def load_int(self, v):
47894789
def __getitem__(self, index):
47904790
return self._new(self.v[index])
47914791

4792+
def __iter__(self):
4793+
return (self._new(x) for x in self.v)
4794+
47924795
@vectorize
47934796
def add(self, other):
47944797
""" Secret fixed-point addition.

0 commit comments

Comments
 (0)