Numerical Computing with IEEE Floating Point Arithmetic

One of the most difficult things about programming is the need to anticipate exceptional situations. Ideally, a program should handle exceptional data in a manner as consistent as possible with the handling of unexceptional data. For example, a program that reads integers from an input file and echoes them to an output file until the end of the input file is reached should not fail just because the input file is empty. On the other hand, if it is further required to compute the average value of the input data, no reasonable solution is available if the input file is empty. So it is with floating point arithmetic. When a reasonable response to exceptional data is possible, it should be used.
The simplest example of an exception is division by zero. Before the IEEE standard was devised, there were two standard responses to division of a positive number by zero. One often used in the 1950s was to generate the largest floating point number as the result. The rationale offered by the manufacturers was that the user would notice the large number in the output and draw the conclusion that something had gone wrong. However, this often led to confusion: for example, the expression 1/0 ? 1/0 would give the result 0, so the user might not notice that any error had taken place. Consequently, it was emphasized in the 1960s that division by zero should lead to the interruption or termination...