On Tue, Apr 25, 2000 at 11:56:48AM -0500, Rob Browning wrote:
> Richard Wackerbarth <[EMAIL PROTECTED]> writes:
> 
> > I think it is best to store exact numbers (for example {3 to 5} as a ratio or 
> > {99 to 165}  for the actual number of shares)
> 
> Well, if we were doing this in a scheme with the full numeric tower,
> then we'd be set since 1/3 would be just fine, but it looks like
> rscheme supports 1/3, but guile converts it to a real...

I would recommend having two separate ints for the numerator and
denominator (new_shares and old_shares) just to avoid such automagic
conversions.  Also using the least common denominator instead of actual
numbers of shares in the conversion table may save a couple CPU cycles when
doing the conversions.  Additionally, this keeps the representation such
that it is easy to understand (3:5 is more obvious than 99:165).

Mike

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


Reply via email to