since the most-significant bits are the offset, you should be able to do the range query without any extra comparator (just compare the bits of the long value).