Skip to content

Commit

Permalink
Fix bigint support (#26)
Browse files Browse the repository at this point in the history
regressed since 65b3c1f
  • Loading branch information
youknowone authored Mar 31, 2024
1 parent 0fb41f3 commit 9e09698
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aheui/aheui.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __init__(self):
self.size = 0

def push(self, value):
# assert(isinstance(value, int))
# assert(isinstance(value, bigint.Int))
node = Link(self.head, value)
self.head = node
self.size += 1
Expand All @@ -129,6 +129,7 @@ def __init__(self):
self.size = 0

def push(self, value):
# assert(isinstance(value, bigint.Int))
tail = self.tail
tail.value = value
new = Link(None)
Expand All @@ -154,10 +155,10 @@ class Port(LinkedList):
def __init__(self):
self.head = None
self.size = 0
self.last_push = 0
self.last_push = bigint.fromint(0)

def push(self, value):
# assert(isinstance(value, int))
# assert(isinstance(value, bigint.Int))
node = Link(self.head, value)
self.head = node
self.size += 1
Expand Down
3 changes: 3 additions & 0 deletions aheui/int/bigint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from rpython.rlib.rbigint import rbigint


Int = rbigint


def fromstr(s):
return rbigint.fromstr(s)

Expand Down
2 changes: 2 additions & 0 deletions aheui/int/smallint.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Int = int


def fromstr(s):
return int(s)
Expand Down

0 comments on commit 9e09698

Please sign in to comment.