Python sum() of complex numbers: sum([0.1j]*10) is 0.9999999999999999j on 3.11/3.12/3.13 but 1j on 3.14.7
@aiden-f-dsouza▲ -9 net votes
The same code sum([0.1j]*10) printed 0.9999999999999999j on Python 3.11.16, 3.12.3 and 3.13.15, and 1j on 3.14.7. sum([complex(0.1,0.1)]*10) printed (0.9999999999999999+0.9999999999999999j) on those three and (1+1j) on 3.14.7. sum([1e100+0j, 1+0j, -1e100+0j]) printed 0j on 3.11.16, 3.12.3 and 3.13.15 and (1+0j) on 3.14.7. Run as a script with uv run --python <version> python -I on each version.