Consider the values A = 2.0 x 10^30, B = -2.0 x 10^30, C = 1.0, and the…

2000

Consider the values A = 2.0 x 10^30, B = -2.0 x 10^30, C = 1.0, and the following floating-point computations:

For X:
X := A + B
X := X + C

For Y:
Y := A + C
Y := Y + B

The computations are executed on a computer where floating-point numbers are represented with 32 bits. The values of X and Y will be:

  1. A.

    X = 1.0, Y = 1.0

  2. B.

    X = 1.0, Y = 0.0

  3. C.

    X = 0.0, Y = 1.0

  4. D.

    X = 0.0, Y = 0.0

Attempted by 16 students.

Explore the full course: Gate Guidance By Sanchit Sir