[issue6198] test_float fails on Windows

Tim Peters report at bugs.python.org
Fri Jun 5 15:58:51 CEST 2009


Tim Peters <tim.peters at gmail.com> added the comment:

> Out of interest, what does '%#.0f' % 1.5 produce on
> Python 2.7/Windows?

Microsoft's float->string routines have always done "add a half and
chop" rounding.  So, yes, 1.5 rounds to 2 there.

> ...
> I suspect that we're in for some complaints when
> Windows users discover that Python 3.1 string
> formatting does round-half-to-even rather than
> the round-half-up they're used to in Python 2.x.

Historically, overall we've had more gripes from non-Windows users
complaining that, e.g., 2.5 does /not/ round up to 3 -- you can't win
here, so don't worry about it.  X-platform consistency is incompatible
with platform-specific behavior, and most users will agree consistency
is overwhelmingly more important.  Of course that won't deter them from
complaining ;-)

----------
nosy: +tim_one

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6198>
_______________________________________


More information about the Python-bugs-list mailing list