Richard Wackerbarth wrote:
> 
> On Fri, 30 Jun 2000, Clark Jones wrote:
> 
> > Well, floating point is definitely NOT the proper solution for US dollars
> On this, I think we finally agree.

:-)

> > One could use multiprecision integer and represent
> > US dollars in "cents", but that becomes a real pain in the tush, and so
> > is not a proper solution, either, IMHO.
> 
> But that is exactly the common implementation of "fixed point", namely
> "scaled integers".

This may have changed in the 20 years or so since I was actually dealing with
them, but the "business oriented" languages usually do it with "binary coded
decimal", rather than scaled integers.  Since few processors support BCD in
their instruction sets (the exception that comes to mind off hand is the Z-80)
this is one of the reasons that the code they produce is so _SSSSLLLLOOOWWW_.

> > nonsense like "73 213/256".  However,
> > the SEC has told the U.S. stock markets "thou shalt decimalize", and though
> > I don't recall off hand exactly when the deadline is, it's within the next
> > few months.
> 
> Except that all of the historical data will still be in the old system for
> some time.

A thought that has occurred to me is that the examples that people are coming
up with are all "binary fractions" of either dollars or cents.  This may be
a useful observation...

> In addition, we still have to handle "$1.99 per dozen"

I think that no matter how we slice it, "7 at $1.99 per dozen" is always going
to involve some roundoff error, especially if "dozen" is a "baker's dozen"!

                                                Clark
-- 
Disclaimer:  The opinions expressed herein are mine and not necessarily
those of anyone else.  (As if anyone else would want them!)

Internet: [EMAIL PROTECTED]             RF: KI7TU
ICBM: 33 22' 01" N 111 43' 52" W        Home Page: www.inficad.com/~jones

--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]


Reply via email to