[Python-Dev] Unifying decimal numbers.

Bill Janssen janssen at parc.com
Tue Nov 8 21:32:59 CET 2005


Might be more interesting to think about replacing ints and Decimal
with implicit-denominator rational type.  In the HTTP-NG typing
proposal, we called this a "fixed-point" type.  See Section 4.5.1 of
http://www.w3.org/Protocols/HTTP-NG/1998/08/draft-frystyk-httpng-arch-00.txt
for details.

The current notion of "int" would be defined as a specific kind of
fixed-point type (a denominator of 1), but other fixed-point types
such as dollars (denominator of 100) or dozens (denominator of 1/12)
could also be defined.  The nice thing about type systems like this is
that they can accurately describe non-binary values, like 1/3.

Bill


More information about the Python-Dev mailing list