What is the result of evaluating the following two expressions using…
2004
What is the result of evaluating the following two expressions using three-digit floating point arithmetic with rounding?
(113. + -111.) + 7.51
113. + (-111. + 7.51) - A.
9.51 and 10.0 respectively
- B.
10.0 and 9.51 respectively
- C.
9.51 and 9.51 respectively
- D.
10.0 and 10.0 respectively
Attempted by 63 students.
Show answer & explanation
Correct answer: A
Key insight: in three-significant-digit floating-point arithmetic, round the result of each operation to three significant digits.
Evaluate (113 + -111) + 7.51
113 + (-111) = 2 exactly → round to three significant digits: 2.00
2.00 + 7.51 = 9.51 (already three significant digits) → final result: 9.51
Evaluate 113 + (-111 + 7.51)
-111 + 7.51 = -103.49 → round to three significant digits: -103
113 + (-103) = 10 → represent with three significant digits as 10.0 → final result: 10.0
Answer: the two expressions evaluate to 9.51 and 10.0 respectively.