This is why you have space filling curves.
https://en.wikipedia.org/wiki/Z-order_curve
With that you can have a linear ordering of space at each scale. Rounding errors become rounding errors. I remember seeing an implementation of that on npm or some such thing.