Skip to content

Commit

Permalink
Fix pow() with negative newint (issue #568)
Browse files Browse the repository at this point in the history
  • Loading branch information
edschofield committed Feb 21, 2024
1 parent 87f7ed4 commit a7dd2cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/future/types/newint.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ def __pow__(self, other):

def __rpow__(self, other):
value = super(newint, self).__rpow__(other)
if value is NotImplemented:
if isint(value):
return newint(value)
elif value is NotImplemented:
return other ** long(self)
return newint(value)
return value

def __lshift__(self, other):
if not isint(other):
Expand Down

0 comments on commit a7dd2cb

Please sign in to comment.