Closed
Description
In lpython v18.1, the class UnsignedInteger, defined in lpython.py doesn't support bitwise shift operators. Please add something like:
def __lshift__(self, other):
if isinstance(other, self.__class__):
return UnsignedInteger(self.bit_width, self.value << other.value)
else:
raise TypeError("Unsupported operand type")
def __rshift__(self, other):
if isinstance(other, self.__class__):
return UnsignedInteger(self.bit_width, self.value >> other.value)
else:
raise TypeError("Unsupported operand type")
Metadata
Metadata
Assignees
Labels
No labels