Completes morton code calculation