prePEP: Decimal data type

Aahz aahz at
Sun Nov 9 09:02:21 CET 2003

In article <jeQr/ks/Kz6B089yn at>,
Mel Wilson <mwilson at> wrote:
>In article <vqgapfommnh7db at>,
>"John Roth" <newsgroups at> wrote:
>>My personal opinion in the matter is that setting the precision
>>high enough so that you won't get into trouble is a hack, and it's
>>a dangerous hack because the amount of precision needed isn't
>>directly related to the data you're processing; it's something that
>>came out of an analysis, probably by someone else under some other
>>circumstances. Given a software implementation, there's a performance
>>advantage to setting it as low as possible, which immediately puts
>>things at risk if your data changes.
>   It puzzles me.  In the COBOL days, we used to worry over setting the
>sizes of our data fields large enough.  We'd set a size we thought was
>ridiculously large and then worry whether today would be the day that
>the company would do the unprecedented amount of business that would
>blow up the night-shift batch runs.  We escaped from that with Python's
>long ints and now we're trying to invent it again.

Division is the fly in the ointment, unfortunately.  The other operations
lead to unbounded-but-finite number sets; division leads to infinite size
unless truncated or rounded.
Aahz (aahz at           <*>

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan

More information about the Python-list mailing list