Implement rich comparison.