Next: 5.5.2 Long Integers Up: 5.5 Operators Previous: 5.5 Operators

### 5.5.1 Integers

The following operations are supported on integers:

• Arithmetic. addition +, subtraction -, multiplication *, division /.

• Comparison. greater-than >, less-than <, equality ==, greater-than-equal

>=, less-than-equal <=.

• Bitwise Arithmetic. bitwise-OR |, bitwise-AND &, bitwise-exclusive-OR `^`, bitwise-NOT .

• Boolean Arithmetic. logical-OR ||, logical-AND &&, logical-NOT !.

When a C statement uses a boolean value (for example, if), it takes the integer zero as meaning false, and any integer other than zero as meaning true. The boolean operators return zero for false and one for true.

Boolean operators && and || stop executing as soon as the truth of the final expression is determined. For example, in the expression a && b, if a is false, then b does not need to be evaluated because the result must be false. The && operator ``knows this'' and does not evaluate b.

Fred G. Martin
Fri Mar 29 17:44:15 EST 1996