[Python-Dev] Decimal data type issues

Edward Loper edloper at gradient.cis.upenn.edu
Thu Apr 15 11:17:56 EDT 2004


> #- > DEFAULT_MAX_EXPONENT = 999999999
> #- > DEFAULT_MIN_EXPONENT = -999999999
> #- > ABSOLUTE_MAX_EXP = 999999999
> #- > ABSOLUTE_MIN_EXP = -999999999

I can think of at least one real use for exponents outside this range: 
probabilities.  E.g., if I'm using probabilistic models to estimate 
P(author|text), I end up multiplying together a large number of very low 
probabilities, and the total probability could easily get this small. 
Of course, people usually use tricks to avoid underflow: taking logs, 
and if necessary performing periodic re-normalization (which means that 
you don't have probabilities anymore, just some sort of likelihood 
measures).  But it might be nice to not have to do those tricks.

I'm +1 for following the lead set by Long, and not adding unnecessary 
limits.

-Edward




More information about the Python-Dev mailing list