Consider the values A = 2.0 x 10^30, B = -2.0 x 10^30, C = 1.0, and the…
GATE · 2000 · CS · Question 2 subparts
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:
- A.
X = 1.0, Y = 1.0
- B.
X = 1.0, Y = 0.0
- C.
X = 0.0, Y = 1.0
- D.
X = 0.0, Y = 0.0
Attempted by 142 students.
Sign up free to check your answer
Sign up freeLoading lesson…