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/2010-March/098655.html below:

[Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

[Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k. [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.Greg Ewing greg.ewing at canterbury.ac.nz
Sun Mar 21 22:47:53 CET 2010
Nick Coghlan wrote:

> That's fine - binary floats *are* surprising. That's why Decimal exists
> in the first place.

This argument could equally well be used the other way --
someone using Decimal is doing so precisely because they
*don't* want to be surprised, in which case they would
probably prefer to get an exception.

The fundamental problem here is that there are two possible
reasons for a mixed float-decimal operation:

1) The user is thinking in terms of floats and has
happened to get a Decimal mixed in somehow.

2) The user is thinking in terms of Decimals and has
happened to get a float mixed in somehow.

There is no way of distinguishing between these
automatically.

-- 
Greg
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