From: Andreas Harnack (ah.boost.01_at_[hidden])
Date: 2007-02-09 07:39:02
I've been following the discussion about physical quantities for some
times now and I'm wondering if someone has thought of representing base
units by prime numbers?
Any positive natural number can unambiguously be split into it's prime
factors, so any rational number would be an unambiguous representation
of a derived dimension with the exponents of the prime factors
representing the exponents of the base dimensions. The only problem are
common factors in nominator and denominator, which could be normalized
using the Euclidean algorithm. Multiplying dimensions is then reduced to
multiplying rational numbers with subsequent normalization. That should
be a lot easier then dealing with sorted lists.
I might find some time to write up an example implementation.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk