sum(sorted([0.16666666666666666, 0.08333333333333333, 0.08333333333333333, 0.08333333333333333, 0.08333333333333333, 0.16666666666666666, 0.16666666666666666, 0.08333333333333333, 0.08333333333333333]))
gives 0.9999999999999999 as an output while the same list having different ordering of elements like
sum([0.16666666666666666, 0.08333333333333333, 0.08333333333333333, 0.08333333333333333, 0.08333333333333333, 0.16666666666666666, 0.16666666666666666, 0.08333333333333333, 0.08333333333333333])
gives 1 as an output.
Any way if the former output can be rounded off to 1?
The unsorted list was an output of an operation on python2.7 code. After migrating our code to python 3.8, the output of the operation changed to sorted list and that affected the sum output.