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:
- 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 16 students.