[system] Repository:
ViewVC logotype

Revision 4714


Jump to revision: Previous Next
Author: sh002i
Date: Fri Dec 8 20:12:20 2006 UTC (7 years, 4 months ago)
Log Message:
backport (dpvc): Provides a formula with units (as opposed to a number
with units). This does introduce some ambiguity issues, since variable
names could look like units in some cases.  E.g., s + 5 m/s could look
like (s + 5*m/s) rather than (s + 5) meters/second.

The parser will take the largest string at the end of the answer that
could be treated as units so s + 5m/s is (s+5) meters/second.

The Units.pm library requries units to be separated by * or / and
only one / is allowed, so s + 5m s is (s+5m) seconds not (s+5) m*s.

Something like 5 m/s/s will generate an error (it shouold be written
m/s*s or m/s^2), and 5 kg m/s should be written 5 kg*m/s.

[If we made the hash of known units be public rather than private in
Units, we could do a better job of this, and could treat kg m/s as
kg*m/s for example.]

Changed paths:

Path Details
Directorybranches/rel-2-3-dev/pg/macros/parserFormulaWithUnits.pl modified , text changed

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9