Closed jonmdev closed 1 month ago
The 64-bit H3Index structure was designed such that only the lower 63 bits were used. This design was chosen so that all valid index values could also be represented with 64 bit signed integers.
Inside the C library we prefer unsigned
, but this is somewhat a style choice and should never change the interpretation of an index.
Great thanks. That's what I thought.
To your knowledge, can the H3 int be a plain signed 64 bit int, or must it be an unsigned 64 bit int? (Range for both is different.) My understanding is any 64 bit int (signed or unsigned) will work by design. But I want to be sure.
https://h3geo.org/docs/core-library/h3Indexing/
https://h3geo.org/docs/3.x/core-library/h3Indexing/
https://h3geo.org/docs/library/terminology/
I am not sure, but I presume in the last reference when they say "unsigned" they mean "no sign is needed" not that it must be an unsigned 64 bit int.
I don't know much about bits, but based on the second reference where numerous of the bits are set to 0, it would seem evident they are not using the entire 64 bit space, right? So does that mean they aren't using ints big enough that this would matter (ie. that they would extend into the positive range only covered by true unsigned 64 bit ints)?
Is this your understanding as well?
Thanks for any help.