
5 Mar
2007
5 Mar
'07
8:54 p.m.
AMDG Dave Steffen <dgsteffen <at> numerica.us> writes:
a) It might be handy, though, to have (for example) a log function that enforces unitless quantities. For example,
log ( velocity * time / meters )
is fine, but if you forget to multiply by the time, you get a helpful error message.
b) It might also be handy, if possible, to have some functions that take units and know what to do; for example, sqrt (m*m) properly returns meters, and so forth.
Absolutely. We already have sin/cos &c. We don't have sqrt but root<2>(m * m) will give give the correct answer (albeit inefficiently). I'll look through cmath and add all the applicable functions. In Christ, Steven Watanabe