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/2004-June/045520.html below:

[Python-Dev] Comparing heterogeneous types

[Python-Dev] Comparing heterogeneous types [Python-Dev] Comparing heterogeneous typesArmin Rigo arigo at tunes.org
Wed Jun 23 06:15:33 EDT 2004
Hello Guido,

On Tue, Jun 22, 2004 at 10:49:51PM -0700, Guido van Rossum wrote:
> (For other operations, I still want to see e.g. long+float to return a
> float rather than a long -- you *have* to do it this way for obvious
> reasons when the values are relatively small, e.g. consider 1 + 0.5.)

Well, just for quick consideration (and probably rejection :-) :

If "a <= b" is to mean we convert a and b to either float or long depending on
their magnitude, would it make any sense at all if other operators like "a +
b" would do the same, to maximize precision?

>>> 1L + 0.5
1.5
>>> L = 100000000000000000000000L
>>> float(L)
9.9999999999999992e+22
>>> float(L+1)
9.9999999999999992e+22
>>> L + 1.0
9.9999999999999992e+22      # currently
100000000000000000000001L   # suggested


Armin

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