Why not FP for Money?

Carlos Ribeiro carribeiro at gmail.com
Sat Sep 25 19:23:55 EDT 2004


On Sat, 25 Sep 2004 11:20:47 -0700, Richard Hanson <me at privacy.net> wrote:
> (I also don't think that Decimal should be thought of as *only* a
> "money" type; but this latter point already seems to be the
> consensus.)

I agree with you, if you meant to say that Decimals are *more* than
simple money representations. I think that my previous posts may have
seeded some confusion with regards to my understanding of this
particular issue.

There are floating point decimals, and fixed point decimals. The
former are generic floating point numbers, as good as the current
binary floats for most situations but with the added advantage of
decimal precision, and the removal of the 'surprise factor' that the
inherent loss of precision of the base conversion causes.

As far as money representation is concerned, it's really a fixed point
decimal. But while discussing it here, I see less and less need of
native support form fixed point decimals. I think that in the long run
the current Decimals will prove more than enough for the task of
handling generic floating point numbers, and that includes money
amounts as a special case. But it's too early to tell.


-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list