Commit 7cf21e76 authored by John Zhang's avatar John Zhang

fix: int<128> 0 constant should be initialised with [0, 0] rather than []

parent b24f70f9
......@@ -192,9 +192,12 @@ class MuBigIntType(MuIntType):
lst = []
val = long(self)
int64_t = MU_INT64._val_type
while(val != 0):
bits = self.BITS
while(bits > 0):
# shift and mask 64 bits off until no more bits
lst.append(int64_t(val & 0xFFFFFFFFFFFFFFFF))
val >>= 64
bits -= 64
return lst
setattr(val_cls, 'get_uint64s', get_uint64s)
......
......@@ -26,6 +26,8 @@ def test_get_int64s():
a = mu_int128(0x1234567890ABCD1234567890ABCDEF)
assert a.get_uint64s() == \
map(mu_int64, [0x1234567890ABCDEF, 0x1234567890ABCD])
a = mu_int128(0)
assert a.get_uint64s() == map(mu_int64, [0, 0])
def test_containers():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment