Rounding a number to nearest even

Chris cwitts at
Tue Apr 15 12:33:03 CEST 2008

On Apr 15, 11:47 am, Duncan Booth < at invalid.invalid>
> Chris <cwi... at> wrote:
> > even is closer to even.75 than even+1.25.  Why should it be rounded
> > up ?
> Because the OP wants to round values to the nearest integer. Only values of
> the form 'x.5' which have two nearest values use 'nearest even' to
> disambiguate the result.
> See
> That's the way I was taught to round numbers when at primary school.

My bad, didn't see he only wanted for halves and handle others as

More information about the Python-list mailing list