|
Boost : |
From: Deane Yang (deane_yang_at_[hidden])
Date: 2003-10-16 10:50:53
David Richardson wrote:
>
> The library has to make some choice about the internal way it represents
> the exponents, and the users just have to follow whatever convention the
> library has.
>
> The concern is if a user stuffs dimensions into the n-tuple that do not
> have the same semantics the library expects (e.g. multiplication of two
> numbers does not result in the exponents in their n-tuples being
> added). If the library is hard coded to do conversion as if the n-tuple
> contained physical dimensions, the library may incorrectly compute types
> for arithmetic expressions.
>
I'm sorry if I confused people. I never meant to say that the user
should be able to specify the semantics of the exponents. I only meant
that the user should be able to define the fundamental dimensions/units
to be used (so, not necessarily mass, length, and time). As far as I
know, you always want to add the exponents when you multiply two
quantities. I even think that this is a mathematical fact and therefore
should be hardwired (just as 2+2 = 4 is hardwired).
But I do think it worthwhile to allow rational exponents (but NOT
arbitrary precision). I'd like someone to show me a real example
where the exponent had a numerator or denominator other than 1, 2, 3, or
4. (Even 4 is, for me, a stretch)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk