Schema

David Merrill dmerrill@lupercalia.net
Wed, 13 Dec 2000 11:29:21 -0500


On Wed, Dec 13, 2000 at 10:15:06AM -0600, Bill Gribble wrote:
> On Tue, Dec 12, 2000 at 06:04:08PM -0500, David Merrill wrote:
> > Would you please give me an example that uses both numerator and
> > denominator in each field? Or a set of example, if that is easier?
> > I'm having trouble seeing how this works.
> 
> I'm not sure what you mean by "uses".  The C data type of the damount
> and of the value is 'gnc_numeric', which is an opaque type.  You can
> do things like add, subtract, multiply, divide values of type
> gnc_numeric.  As an implementation detail (partially exposed in the
> API), every gnc_numeric has an integer numerator and an integer
> denominator.

Sorry, I'll try again. I understand the mathematical implications of
why you use gnc_numeric. What I don't understand is what entity the
numerator represents and what entity the denominator represents. In a
cash account, for example, why would you need a rational number to
store a value? What situation would arise that wouldn't be some number
over 100? Or am I thinking too much like an American, and some
currencies could actually be held in the amount of 3/16, for example?

Or does it apply mostly to stocks?

If I wind up storing the numerator and denominator in separate integer
fields in the database, what would be a very expressive name for those
fields? If they were properties of an object, what would they be
named? Describe in a sentence what each of them *is*.


-- 
Dr. David C. Merrill                     http://www.lupercalia.net
Linux Documentation Project                dmerrill@lupercalia.net
Collection Editor & Coordinator            http://www.linuxdoc.org
                                       Finger me for my public key

Bilbo's First Law:
	You cannot count friends that are all packed up in barrels.