3.4 Constant expressions

-------------------------

A constant expression is one or more numeric constants related by

operators. The numeric value of the expression is calculated once during

compilation and then only its constant value is used.

Like all expressions in C--, constant expressions are always calculated

from left to right, contrary to the usual rules of arithmetic. This is

unlike the situation in other computer languages, and you must be careful

when writing expressions to remember that 2+3*2 equals 10 and not 8.

Some examples of constant expressions:

45 & 1 + 3 // equals 4

14 - 1 / 2 // equals 6 (remember to use integer values)

1 * 2 * 3 / 2 + 4 // equals 7

Example using floating-point numbers

3.23*1.53+2.0E2 // equals 204.9419