In the following program where I repeatedly half an integer, it takes until
i = 1074 for my integer to be equal to zero (I know that ideally the while loop shouldn't have ended, and the reason why it stopped was because of the memory limit of the computer).
a = 1.0 i = 0 while a != 0: a = a / 2 i = i + 1 print(a, i)
However, the next program, where I compare the halved integer using addition ends at
i = 53.
a = 1.0 b = 1.0 i = 0 while a + b != b: a = a / 2 i = i + 1 print(a, i)
My question is why is there a big difference here? Why does the first program go up to
1075 iterations, while the latter goes up to
Also, when I tried
a + b + c != b + c, it went up to just
a + b + c + d != b + c + d
only went up to
51. Why isn't there a big difference here?