[Python-Dev] Re: Re: Decimal type question [Prothon]

Raymond Hettinger python at rcn.com
Sun Aug 8 21:42:38 CEST 2004


>  I have been assuming that there is a
> fundamental need for an integer type that has no fraction.

The IBM spec covers almost all needs except speed and space (and even
those aren't horrible in a good C implementation).  It is a superset of
754/854, of fixed point, and of high precision integer arithmetic.  If
you were bold, you would have this as the sole numeric type.  This would
spare you decimal representation issues, inadequate range/precision
problems, type conversion issues, and compatibility challenges.  Plus,
it is darned nice to have something as thoroughly thought out and
tested.

Of course, if you want to roll your own from scratch, I hear that it is
trivially easy and that everything always works out in the end, NOT!


Raymond



More information about the Python-Dev mailing list