[Python-Dev] Fixed-decimal types

Guido van Rossum guido@CNRI.Reston.VA.US
Thu, 23 Dec 1999 14:44:36 -0500


Jim Fulton wrote:

>   - for addition and subtraction of two "exact" (fixed-decimal)
>     numbers, the result has the maximum of the scales.

One could argue that this is incorrect: if "3.1" means that I know the
value to one decimal of precision, and "2.01" means that I know that
value to two decimals of precision, stating the result of their sum as
"5.11" suggests that I know the result to two decimals of precision,
which is of course false: because I only knew one decimal of precision
for one of the operands, I only know (at most!) one decimal of
precision for the result.

Not arguing for this interpretation, just indicating that doing fixed
precision arithmetic right is hard.  I'm waiting for Tim Peters'
contribution, but he's on vacation so it may be a while.

--Guido van Rossum (home page: http://www.python.org/~guido/)