Correct max and min size for 32 bit integer? #10315
Answered
by
peterhinch
TheFern2
asked this question in
Unix & Windows
-
For python3 that is -2147483648 through 2147483647. However -2147483648 causes an overflow in upy. Both on unix and esp32 ports. I decrease to -2147483647 and that fixed my overflow issue. I was using it in the contest of:
In unix port my unittest that was expecting the randint was just stuck with no exceptions or errors probably a port bug. On esp32 1.19 I was getting the overflow error and that's how I found the issue. |
Beta Was this translation helpful? Give feedback.
Answered by
peterhinch
Dec 24, 2022
Replies: 1 comment
-
Python integers are unbounded. At the C level a MicroPython small int is 30 bits. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
TheFern2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python integers are unbounded. At the C level a MicroPython small int is 30 bits.