Commit a814daa7 authored by Damien George's avatar Damien George

leon: Add another Spacebel test, 1651, to test large range of small int.

parent 72406635
-8796093022208
8796093022207
-17592186044416
17592186044415
-35184372088832
35184372088831
-70368744177664
70368744177663
MemoryError
# test that small int range is 2**46-1
import micropython
def check(n):
micropython.heap_lock()
x = -(2**(n - 1)) * 2
y = -(x + 1)
print(x)
print(y)
micropython.heap_unlock()
check(43)
check(44)
check(45)
check(46)
try:
check(47)
except MemoryError:
print('MemoryError')
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