A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-February/076973.html below:

[Python-Dev] Different float formatting on Windows and Linux

[Python-Dev] Different float formatting on Windows and Linux [Python-Dev] Different float formatting on Windows and LinuxTerry Reedy tjreedy at udel.edu
Tue Feb 19 02:17:22 CET 2008
"Eric Smith" <eric+python-dev at trueblade.com> wrote in message 
news:47B9680B.3000609 at trueblade.com...
| The tests for float.__format__ are breaking on Windows, because of this
| issue: http://bugs.python.org/issue1600.  Basically, Windows is using 3
| digits for exponents < 100, and Linux (and at least MacOS) are using 2.
|
| The patch attached to the issue proposes changing all platforms to use
| at least 3 digits.  It affects both '%' formatting and __format__
| formatting.  Altering all float formatting involving exponents is a
| pretty big change to make, and I want to get opinions here before making
| this change.
|
| Guido's comments in the issue are supportive, and I agree that the
| consistency would be good.  I'm just concerned about changing the output
| for existing code.
|
| I suppose another option would be to modify Windows to use 2 digits for
| exponents < 100.  I guess it just depends on whose output you want to 
break!
|
| I think the options are:
| 1: Do nothing.  Adapt the tests to deal with the differences.
| 2: Force 3 characters for exponents < 100.
| 3: Force 2 characters for exponents < 100.

Since you posted this, Mark Dickensom added a comment to the tracker that 3 
conforms to C99.  If so, go with that.  In any case, consistency would be 
nice.

tjr



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4