add rlshift and rrshift special methods (#7185)

This commit is contained in:
ignaciosica 2024-10-21 09:37:02 -03:00 committed by GitHub
commit 5551cf6689
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,7 +55,9 @@ class MathTrait:
def __mul__(self, x): return self.alu(BinaryOps.MUL, self.ufix(x))
def __rmul__(self, x): return self.ufix(x).alu(BinaryOps.MUL, self)
def __lshift__(self, x): return self.alu(BinaryOps.SHL, self.ufix(x))
def __rlshift__(self, x): return self.ufix(x).alu(BinaryOps.SHL, self)
def __rshift__(self, x): return self.alu(BinaryOps.SHR, self.ufix(x))
def __rrshift__(self, x): return self.ufix(x).alu(BinaryOps.SHR, self)
def __floordiv__(self, x): return self.alu(BinaryOps.IDIV, self.ufix(x))
def __rfloordiv__(self, x): return self.ufix(x).alu(BinaryOps.IDIV, self)
def __truediv__(self, x): return self.alu(BinaryOps.MUL, self.ufix(x).alu(UnaryOps.RECIP))