If statement - checking only the first 5 MSB's.

Of course, portability is not generally the number one concern for someone writing code for Arduino! 8^)