Reverted some changes as not to depend on partialCompare being exactly -1.0, 0.0, 1.0.