This is a generic implementation for (non-commutative) rings
which only works for the one element, its additive inverse, and
the zero element. Most rings should provide a more specialized
implementation.