QUERY · ISSUE
urandom.randint handling of >32bit values on 64-bit arch
bugextmod
Noticed this while looking at https://github.com/micropython/micropython/issues/6712
>>> random.randint(0, 2**32)
0
>>> random.randint(0, 2**32-1)
(hangs)
On 32-bit platforms, both these examples would fail to convert the second argument to a small int (which I think is the correct behaviour for MicroPython).
On 64-bit though, they're valid small integers, but then there's an implicit conversion to uint32_t in yasmarang_randbelow.
I guess either we could use a 64-bit Yasmarang on 64-bit arch? Or add another check?
CANDIDATE · PULL REQUEST
Fix compilation warnings for Windows 64 bits
extmod
Hi
Here is some missing cast and other minor change that prevent compilation warning if mp_int_t is defined as integer 64 bits.