Efficient arithmetic for space partitioning