HP C A.06.05 Reference Manual

Expressions and Operators
Assignment Operators (=, +=, -=, *=, /=, %=,<<=, >>=, &=, ^=, |=)
Chapter 592
Floating-Point Overflows A serious problem occurs when the value being assigned is too
large to be represented in the variable. For example, the largest positive number that can be
represented by a float is approximately 3e38. However, neither the K&R language definition
nor the ANSI/ISO C standard defines what happens if you try to make an assignment outside
this range. Suppose, for example, that your program contains the following assignment:
f = 2e40;
In this simple case, the compiler recognizes the problem and reports a compile-time error. In
other instances, however, a run-time error could result.
Example
/* Following are examples of the use of each
* assignment operator. In each case, x = 5
* and y = 2 before the statement is executed. */
x = y; x = 2
x += y + 1; x = 8
x -= y * 3; x = -1
x *= y + 1; x = 15
x /= y; x = 2
x %= y; x = 1
x <<= y; x = 20
x >>= y; x = 1
x &= y; x = 0
x ^= y; x = 7
x |= y; x = 7
x = y = 1 x = 1, y = 1