◐ Shell
clean mode source ↗

Message 249849 - Python tracker

> By the way, why does Python use ROUND_HALF_EVEN for round()?

ROUND_HALF_EVEN does not introduce statistical bias in your floating point data.  With this choice a randomly chosen decimal has an equal chance of being rounded up or down.  I think one can prove the same for a binary float being converted to a decimal with a fixed number of places after dot.  The builtin round() is a unique beast and I would have to ask Mark to know what its statistical properties are, but in general round-half-to-even is justified by the desire of not introducing a statistical bias and I don't think the natural asymmetry of the time line matters in this argument.