Boost logo

Boost :

From: Eric Ford (eford_at_[hidden])
Date: 2001-10-01 16:51:56

> What about assigning a different prime number to each dimension, and
> representing multiplication of units as multiplication of the
> primes? This guarantees a unique number for every combination of
> It also solves the decomposition problem (extracting the basic units
> their exponents from a composite unit), which I suspect may be a
> showstopper for your addition-of-hash-values approach.
> (Actually the numbers would have to be rationals rather than
integers to
> allow for negative powers, but compile-time rational arithmetic
> shouldn't be too difficult to implement. We already have a
> GCD algorithm.)

But how do you handel rational powers? I beleive it's possible with
two of these, one for the numerator and one for the denominator, but
then you have to worry about reducing fractions. That could get


Boost list run by bdawes at, gregod at, cpdaniel at, john at