fractional parts

Matthew Lepper mlepper@bellatlantic.net
Wed, 19 Jul 2000 20:28:11 -0400


I think the way to use this factoid is to define a data type
that uses three integers to represent values: 
1) integer units -- for USD this would be dollars
2) fractional numerator
3) fractional denominator

This basic structure may have been proposed and dismissed
already, I haven't been able to follow the whole discussion.

This would allow you to do exact math on almost all 
resonable bits and peices of a base unit.  It seems 
appropriate that the units would use a 64-bit number and
the fractional bits would be 32-bit numbers.  Pennies
would simply use a denominator of 100.  Securities quotes
would use denominators or 2,4,...  Heck, you could even
represent old english denominations!

Basic math is simple.  It doesn't help the problem of when
values get rounded, but it can easily represent the result.

--
Matthew Lepper


Richard Wackerbarth wrote:
> 
> On Wed, 19 Jul 2000, Terry wrote:
> 
> > > > Again, I do have a valid reason for asking and which relates to gnucash
> > > > directly.
> > > I fail to see how this relates to gnucash. Just because there are a limited
> > > number of fractions in common usage (I would guess that is caused by the human
> > > inability to readily compare fractions with unlike denominators) I see nothing
> > > to be gained by attempting to enumerate those denominators.
> >
> > Yes oh omnipotent, un-failing, all-seeing, all-knowing one - since you have
> > decreed, we shall all bow in obedience now that you have made us see the
> > unworthiness of our ways
> >
> > Sorry - I really, really could not stop myself :-)
> 
> I do see that, rather than attempt to explain the relationship, you prefer to
> ridicule my statement.
> You will note, (if you can read), that I did not in any way exclude the
> possibility that there was something to be gained in attempting to enumerate
> the frequently used denominators.
> 
> I still fail to see how it helps. Your last remarks did not clarify it at all.
> 
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel@lists.gnumatic.com
> http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel