I would love to see what this is being compared against, in order to describe this as 'elegant'.
In my dictionary, elegance requires something to be as simple as practicable, but
Bitwise comparisons are really inefficient, and extremely hard to debug by eye.