Very efficient, but, unlike the less efficient possibility in the question, this depends on the specific representation of ordinals by sets. It works for the usual von Neumann ordinals, but not for other possible representations.
–
Andreas BlassDec 26 '12 at 16:42