I had a thought ... (I know, call the newspapers).

Greg Jorgensen gregj at pobox.com
Fri Jun 1 00:16:44 EDT 2001


The general case of the "currency" or "money" type is called fixed point or
fixed decimal. As opposed to floating point, fixed decimal numbers always
have the same number of digits to the right of the decimal point. This means
the decimal point can be implicit, and it also means that integer match can
be used. If you count in pennies instead of fractional dollars you get the
idea. A good fixed-point math package is more sophisticated than I'm
describing (mainly to deal with computational precision beyond the fixed
number of digits), but you get the idea.

Fixed decimal is the norm in COBOL and Oracle and many other languages and
tools. Fixed decimal math can be much faster than floating-point math,
though the performance gap closed in the late '80s.

I can't comment on Microsoft's claims regarding Visual Basic's currency
type, but they certainly could have implemented fixed-point math without a
floating-point processor. That was done back in the 1950s.

Greg Jorgensen
PDXperts LLC
Portland, Oregon, USA
gregj at pobox.com





More information about the Python-list mailing list