Skip to main content

GATE CSE 2004Digital Logic › Number Systems & RepresentationVerified

GATE CSE 2004 PYQ: What is the result of evaluating the following two expressions using three-digit floating point arithmetic…

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

113.+(−111.+7.51)113. + (-111. + 7.51)

  1. A

    9.51 and 10.0 respectively

    Correct answer
  2. B

    10.0 and 9.51 respectively

  3. C

    9.51 and 9.51 respectively

  4. D

    10.0 and 10.0 respectively

Answer

(A) 9.51 9.51 9.51 and 10.0 10.0 10.0 respectively

Approach

Use 3-significant-digit decimal floating-point arithmetic; perform each addition and round to three significant digits after each operation, especially after the inner parentheses.

With only three significant digits, the intermediate sum in the second expression must be rounded. The inner sum -111 + 7.51 equals -103.49, which rounds to -103; then 113 + (-103) = 10.0. The first expression has no such loss: 113 + (-111) = 2.0, then 2.0 + 7.51 = 9.51. Hence Option A is correct.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.