Boolean logic does not just work with numbers. Boolean expressions can also compare text, for example to check if a password is correct.
For a complete discussion of the rules for evaluating compound expressions, see Order of Evaluation in Compound Expressions. Using Parentheses to Control Order of Evaluation Even though SAS evaluates ...