Python3.4 rounds to the nearest even (in the tie-breaker case).
>>> round(1.5)
2
>>> round(2.5)
2
But it only seems to do this when rounding to an integer.
>>> round(2.75, 1)
2.8
>>> round(2.85, 1)
2.9
In the final example above, I would have expected 2.8 as the answer when rounding to the nearest even.
Why is there a discrepancy between the two behaviors?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…