PEP 327: Decimal Data Type

Josiah Carlson jcarlson at nospam.uci.edu
Fri Jan 30 21:30:22 CET 2004


> (In my dreams) I want to "float" to be decimal. Always. No more binary.
> Maybe in ten years the machines will be as fast as is needed to make this
> posible. Or it'll be implemented in hardware. 
> 
> Anyway, until then I'm happy having decimal floating point as a module.


In my dreams, data is optimally represented in base e, and every number 
is represented with a roughly equivalent amount of fudge-factor (except 
for linear combinations of the powers of e).

Heh, thankfully my dreams haven't come to fuition.


While decimal storage is useful for people and money, it is arbitrarily 
limiting.  Perhaps a generalized BaseN module is called for.  People 
could then generate floating point numbers in any base (up to perhaps 
base 36, [1-9a-z]).  At that point, having a Money version is just a 
specific subclass of BaseN floating point.

Of course then you have the same problem with doing math on two 
different bases as with doing math on rational numbers.  Personally, I 
would more favor a generalized BaseN class than just a single Base10 class.

  - Josiah



More information about the Python-list mailing list