Skip to content

Commit 9bb27ee

Browse files
committed
Update _sintba.py
Correction to take care of the int case.
1 parent 5e4b551 commit 9bb27ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

myhdl/numeric/_sintba.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,12 @@ def __ifloordiv__(self, other):
346346
return self
347347

348348
def __imod__(self, other):
349-
result = self % other
349+
right = copy(other)
350+
if isinstance(right, int):
351+
right = sintba(right)
352+
if self.high > right.high:
353+
right = right.resize(self.high, right.low)
354+
result = self % right
350355
if self.is_signed:
351356
value = result.resize(self.high, self.low)
352357
else:

0 commit comments

Comments
 (0)