We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74f4d2c commit f62503dCopy full SHA for f62503d
tests/micropython/const_intbig.py
@@ -0,0 +1,13 @@
1
+# test constant optimisation, with consts that are bignums
2
+
3
+from micropython import const
4
5
+# check we can make consts from bignums
6
+Z1 = const(0xffffffff)
7
+Z2 = const(0xffffffffffffffff)
8
+print(hex(Z1), hex(Z2))
9
10
+# check arithmetic with bignum
11
+Z3 = const(Z1 + Z2)
12
+Z4 = const((1 << 100) + Z1)
13
+print(hex(Z3), hex(Z4))
tests/micropython/const_intbig.py.exp
@@ -0,0 +1,2 @@
+0xffffffff 0xffffffffffffffff
+0x100000000fffffffe 0x100000000000000000ffffffff
0 commit comments