|
Boost : |
From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-10-16 03:26:44
| David Abrahams wrote:
| > David Richardson wrote:
| >
| >> Deane Yang wrote:
| >>
| >>> c) Automatic generation of new types when two different quantities
| >>> are multiplied or divided
| >>
| >> I'm a bit confused how this would work (maybe because I've been
| >> thinking about this as a physics problem). Do we just pick an
| >> arbtrary rule for the production of new types/units?
| >
| > No, mathematics gives the rules. You can see examples in my slides at
| > http://www.boost-consulting.com/writing/ACCU_MPL_slides.ppt
Very thought-provoking - if brain-hurting ;-)
|
| The slides have examples where the units are from physics. So you
| represent a number's units as a n-tuple of exponents with each
| exponent corresponding to one of the fundamental SI units.
| Arithmetic operations on numbers with these units have well
| defined rules to compute the resulting units.
|
| If the semantics of the exponents in the n-tuple are user defined, ...
<snipped>
Would an example here be if the exponents in the n-tuple were of type rational
rather than type integer?
Could this meet the need for fractional dimensions?
(At the cost of making it even more complicated! Especially to ensure it doesn't
have a run-time cost).
Paul
Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
mailto:pbristow_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk