If a real number is not exactly one of the representable floating-point numbers, then the nearest floating-point number must represent it. The rounding error is the difference between the exact real number and its nearest floating-point representation. If the rounding error is non-zero, the rounded floating-point number is called inexact.
Normally, calculations proceed when an inexact value results. Almost any floating-point operation can produce an inexact result. The rounding mode (round up, round down, round nearest, truncate) is determined by the floating-point control word.
If an arithmetic operation results in a floating-point number that cannot be represented in a specific data type, the operation may produce a special value: signed zero, signed infinity, NaN, or a denormal. Numbers that have been rounded to an exactly representable floating-point number also result in a special value. Special-value results are a limiting case of the arithmetic operation involved. Special values can propagate through your arithmetic operations without causing your program to fail, and often provide usable results.
If an arithmetic operation results in an exception, the operation can cause an underflow or overflow:
Underflow occurs when an arithmetic result is too small for the math processor to handle. Depending on the setting of the /fpe compiler option, underflows are set to zero (they are usually harmless) or they are left as is (denormalized).
Overflow occurs when an arithmetic result is too large for the math processor to handle. Overflows are more serious than underflows, and may indicate an error in the formulation of a problem (for example, unintended exponentiation of a large number by a large number). Overflows generally produce an appropriately signed infinity value. (This depends on the rounding mode as per the IEEE standard.)
An arithmetic operation can also throw the following exceptions: divide-by-zero exception, an invalid exception, and an inexact exception.
You can select how exceptions are handled by setting the floating-point control word.