
At 2001-02-11 21:18, Tom Pledger wrote:
The main complication is that the type system needs to deal with integer exponents of dimensions, if it's to do the job well.
Very occasionally non-integer or 'fractal' exponents of dimensions are
useful. For instance, geographic coastlines can be measured in km ^ n,
where 1 <= n < 2. This doesn't stop the CIA world factbook listing all
coastline lengths in straight kilometres, however.
More unit weirdness occurs with logarithms. For instance, if y and x are
distances, log (y/x) = log y - log x. Note that 'log x' is some number +
log (metre). Strange, huh?
Interestingly, in C++ you can parameterise types by values. For instance:
--
// Mass, Length and Time
template