[Python-Dev] Re: WYSIWYG decimal fractions

M.-A. Lemburg mal@lemburg.com
Thu, 15 Mar 2001 17:31:34 +0100


Guido van Rossum wrote:
> 
> I'll say one thing and then I'll try to keep my peace about this.
> 
> I think that using rationals as the default type for
> decimal-with-floating-point notation won't fly.  There are too many
> issues, e.g. performance, rounding on display, usability for advanced
> users, backwards compatibility.  This means that it just isn't
> possible to get a consensus about moving in this direction.
> 
> Using decimal floating point won't fly either, for mostly the same
> reasons, plus the implementation appears to be riddled with gotcha's
> (at least rationals are relatively clean and easy to implement, given
> that we already have bignums).
> 
> I don't think I have the time or energy to argue this much further --
> someone will have to argue until they have a solution that the various
> groups (educators, scientists, and programmers) can agree on.  Maybe
> language levels will save the world?

Just out of curiosity: is there a usable decimal type implementation
somewhere on the net which we could beat on ?

I for one would be very interested in having a decimal type
around (with fixed precision and scale), since databases rely
on these a lot and I would like to assure that passing database
data through Python doesn't cause any data loss due to rounding
issues.

If there aren't any such implementations yet, the site that Tim 
mentioned  looks like a good starting point for heading into this 
direction... e.g. for mx.Decimal ;-)

	http://www2.hursley.ibm.com/decimal/

I believe that now with the coercion patches in place, adding
new numeric datatypes should be fairly easy (left aside the
problems intrinsic to numerics themselves).

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Pages:                           http://www.lemburg.com/python/