Proposal for modifying gnucash to use exact quantities
Richard Wackerbarth
rkw@dataplex.net
Tue, 1 Aug 2000 22:21:30 -0500
On Tue, 01 Aug 2000, Jason Rennie wrote:
> rkw@dataplex.net said:
> > 2) The "denominator" may need to be the reciprocal of an integer
> > greater than unity.
>
> Since the denominator should never be negative or zero if it is acting
> in its normal role, we could say that a negative denominator acts as a
> reciprocal of the absolute value of that number. Richard, what would
> you propose?
That you abandon such notions of encoding.
You are assuming that the representation of "denominator" permits negative
values. It might not. Further, attempting to encode different meanings into a
single value in this manner generally leads to code that is less efficient
and often becomes the source of coding errors.
Where I need to store these conversion factors, I would store them in (some
equivalent of) rational numbers where these have both a numerator and a
denominator, even though in all cases that I have observed one of those will
be unity.