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

Adam Olsen rhamph at gmail.com
Sun Mar 21 00:58:28 CET 2010

On Sat, Mar 20, 2010 at 17:20, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> There are two ways in which that linear tower is overly
> simplistic:
> * It conflates the notions of exactness and width. They're
> really orthogonal concepts, and to reflect this you would
> need two parallel towers, with exact and inexact versions
> of each type.
> * Decimal and float really belong side-by-side in the
> tower, rather than one above the other. Neither of them is
> inherently any more precise or exact than the other.
> There doesn't seem to be any good solution here. For every
> use case in which Decimal+float->float appears better, there
> seems to be another one for which Decimal+float->Decimal
> appears better.

Sure, from a purist point of view my post is completely wrong.  It
doesn't correspond to the mathematical reality.

What it does correspond to is the code.  Only going rightward through
the types is what we have today.  A linear progression is a lot
simpler to understand than any sort of cycle; parallel progressions
isn't even on the table.

float has been the king of inexact types right for a long time.  All
other things being equal, that's good enough for me.

Adam Olsen, aka Rhamphoryncus

More information about the Python-Dev mailing list