trevorprater/pymorton

Defaults to 32 bit functions on 64 bit installation of Python

thdb-theo opened this issue · 1 comments

Because sys.maxint no longer exists, the code uses the 32 bit version of the functions. interleaving 0xffff and 0xffff yields the same result as 0xfffff and 0xffff since it's using the 32 bit function and the result should be 33 bits long.

Screenshot from 2023-03-29 17-15-04

The issue lies here:

if getattr(sys, 'maxint', 0) and sys.maxint <= 2 ** 31 - 1:

I also have this issue. Just have some very large numbers (64bit) that need to get the morton index for (geospatial mapping stuff), and it fails to function if the numbers are too large.