[Python-Dev] Decimal data type issues

Tim Peters tim_one at email.msn.com
Fri Apr 16 00:17:24 EDT 2004

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

[Edward Loper]
> 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.

No, it couldn't -- and if you worked hard to contrive an example, a
probability in the end smaller than the probability that the universe will
spontaneously decide to run time backwards for a century is accurately
enough represented by 0 (which your example will underflow to).

More information about the Python-Dev mailing list