
ERRORS AND EXCEPTIONS
99
This example enables all possible floating-point exceptions except for the
floating-point stack overflow,
. Alternativ ely,
enable specific exceptions by using only selected exception masks, such as
. Program 4–3 uses similar code in the context of a larger example.
Errors and Exceptions
An error can be thought of as a situation that could occur occasionally in known
locations. System call errors, for example, should be detected and reported imme-
diately by logic in the code. Thus, programmers normally include an explicit test
to see, for i nstance, whether a file read operation ha
s fai led. The
function was developed in Ch