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/098711.html below:

[Python-Dev] Mixing float and Decimal -- thread reboot

[Python-Dev] Mixing float and Decimal -- thread reboot [Python-Dev] Mixing float and Decimal -- thread rebootPaul Moore p.f.moore at gmail.com
Mon Mar 22 21:45:05 CET 2010
On 22 March 2010 19:32, Mark Dickinson <dickinsm at gmail.com> wrote:
> I think getting this to work would involve a lot of extra code and
> significant 'cleverness'.  I'd prefer the simple-to-implement and
> simple-to-explain option of rounding the Fraction before performing
> the operation, even if this means that the whole operation involves
> two rounding operations.  It's not so different from what currently
> happens for Fraction+float, or even int+float.

My instinct throughout this discussion has been that

    a_decimal + a_fraction

is in effect

    a_decimal + a_fraction.numerator / a_fraction.denominator

and as the numerator and denomination can be converted into exact
decimals, my instincts "expect" a double rounding. Anything else
effectively means implementing partial cases of  (a+b/c) treated as a
ternary operation.

So I guess I'm +1 on Mark's suggestion.
Paul.
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