 
                            ...
| Code Block | ||
|---|---|---|
| 
 | ||
| double a = 3.0,; double b = 7.0, c; double c = a / b; if (c == a / b) { printf ("comparisonComparison succeeds\n"); } else { printf ("unexpectedUnexpected result\n"); } | 
On a test IA-32 Linux machine with GCC Compiler Version 3.4.4 this code prints:
| Code Block | 
|---|
| unexpectedUnexpected result | 
But when it is compiled with the -O option this code prints:
| Code Block | 
|---|
| comparisonComparison succeeds | 
Risk Analysis
Failing to understand the limitations of floating point numbers can result in unexpected mathematical results and exceptional conditions, possibly resulting in a violation of data integrity.
...