One of the big issues seems to be whether we have just one denominator
for a commodity, or many.  Examples are being thrown around about
whether there is a quantum unit of a commodity,  whether it changes,
and how often, and whether the quantum unit is so intrinsic to a commodity
that, say,  milk bought by the gallon is a different commodity from
milk bought by the quart.  Indeed, if every transaction involves its
own denominator, independent of any other, using a fixed denominator
would seem to be madness.  It all transactions can be expressed in the
same denominator, which is known a priori, there is no need to store it
with every transaction. The choice of data representation is merely an
optimization issue.

Reality does not seem to be as neat as either of these extremes,
though, and so the optimisation issue may have to resolved by a compromise.

Let each commodity to have its own common denominator, but change this
denominator when new transactions make it necessary.  The new denominator
be a multiple of the old one.  Changing a denominator involves retroactively
rewrite all existing transactions that involved that denominator.

In typical situations the I imagine, the denominator for any commodity
will settle down after a few transactions, after which all remaining
transactions will be expressible in exact multiples of the final
quantum.  Even if an exchange redenominates fron 1/64 to 1/100,
this would only change our common denominator for one of its
commodities from 1/64 to 1/1600.

-----

There is one nightmare situation for this approach: a series of
transactions in a commodity whose amounts have relatively prime
denominators.  For example you might buy milk on consecutive days:
1/liter, 1/3 liter, 1/5 liter, 1/7 liter, 1/11 liter, 1/13 liter,
1/17 liter, 1/19 liter, 1/23 liter, 1/29 liter.  The denominator will
skyrocket, and reach the limit of 32 or 64-bit integer representation
rather quickly, after which your grocery-budget accountant will
worry about thee gnucash integer overflow.

Actually, a problem that none of the proposals in this mailing list
addresses is the possibility that a commodity mught be bought and
sold in units whose conversion factors are irrational.  Can you, for
example buy angles in degrees and sell them in radians?  Now the accountant
can no longer  remain silent.  He formally accuses you of being a
mathematician. :-)

-- hendrik.

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


Reply via email to