A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-March/043705.html below:

[Python-Dev] Expert floats

[Python-Dev] Expert floatsKa-Ping Yee python-dev at zesty.ca
Tue Mar 30 12:50:46 EST 2004
On Tue, Mar 30, 2004, Edward Loper wrote:
>
> But I'm not particularly happy about the fact that you have to be an
> expert to understand the intricacies of basic arithmetic with floats
> (not that I have a way to fix it).

On Tue, 30 Mar 2004, Aahz wrote:
>
> >>> 1.1
> 1.1000000000000001
>
> Just a fact of life.  :-/

I regret that this "feature" was ever introduced or "fixed" or what have
you.  Things were much better when repr(1.1) was "1.1" a few versions ago.

This inconsistency is strange and surprising to every Python learner and
I still believe there is no good reason for it.  The motivation, as i
remember it, was to make repr(x) produce a cross-platform representation
of x.  But no one uses repr() expecting bit-for-bit identity across
platforms.  repr() can't even represent most objects; if you want to
transfer things between platforms, you would use pickle.

If typing in "1.1" produces x, then "1.1" is a perfectly accurate
representation of x on the current platform.  And that is sufficient.

Showing "1.1000000000000001" is a clear case of confusing lots of people
in exchange for an obscure benefit to very few.  If i could vote for
just one thing to roll back about Python, this would be it.


-- ?!ng

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