Unformatted text preview: en led to total
disaster: for example the expression 1=0 ; 1=0 would then have a result of 0,
which is completely meaningless furthermore, as the value is not large, the
21 user might not notice that any error had taken place. Consequently, it was
emphasized in the 1960's that division by zero should lead to the generation
of a program interrupt, giving the user an informative message such as \fatal
error  division by zero". In order to avoid this abnormal termination, the
burden was on the programmer to make sure that division by zero would never
occur. Suppose, for example, it is desired to compute the total resistance in
an electrical circuit with two resistors connected in parallel, with resistances
respectively R1 and R2 ohms, as shown in Figure 4. R1 R2 The standard formula for the total resistance of the circuit is
1
T= 1 + 1:
R1 R2
This formula makes intuitive sense: if both resistances R1 and R2 are the
same value R, then the resistance of the whole circuit is T = R=2, since the
current divides equally, with equal amounts owing through each resistor.
On the other han...
View
Full Document
 Spring '09
 LIE
 oating point

Click to edit the document details