[system] / trunk / pg / macros / parserFormulaWithUnits.pl Repository:
ViewVC logotype

Log of /trunk/pg/macros/parserFormulaWithUnits.pl

Parent Directory Parent Directory

Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 4673 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 27 04:21:59 2006 UTC (13 years, 2 months ago) by dpvc
File length: 943 byte(s)
Diff to previous 4670
Moved the guts of this to pg/lib/Parser/Legacy/NumberWithUnits.pl,
since most of the code is common.  This is a shell that now only
defines the FormulaWithUnits() function.

Revision 4670 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 27 00:08:31 2006 UTC (13 years, 2 months ago) by dpvc
File length: 4930 byte(s)
Diff to previous 4668
Fixed usage comments to do formulas rather than just numbers.

Revision 4668 - (view) (download) (as text) (annotate) - [select for diffs]
Added Sun Nov 26 23:59:22 2006 UTC (13 years, 2 months ago) by dpvc
File length: 4896 byte(s)
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.]

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9