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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5373 - (download) (as text) (annotate)
Sun Aug 19 02:01:57 2007 UTC (12 years, 3 months ago) by dpvc
File size: 1002 byte(s)
Normalized comments and headers to that they will format their POD
documentation properly.  (I know that the POD processing was supposed
to strip off the initial #, but that doesn't seem to happen, so I've
added a space throughout.)

    1 
    2 loadMacros('MathObjects.pl');
    3 
    4 sub _parserFormulaWithUnits_init {}; # don't reload this file
    5 
    6 =head1 DESCRIPTION
    7 
    8  ######################################################################
    9  #
   10  #  This is a Parser class that implements a formula with units.
   11  #  It is a temporary version until the Parser can handle it
   12  #  directly.
   13  #
   14  #  Use FormulaWithUnits("num units") or FormulaWithUnits(formula,"units")
   15  #  to generate a FormulaWithUnits object, and then call its cmp() method
   16  #  to get an answer checker for your formula with units.
   17  #
   18  #  Usage examples:
   19  #
   20  #      ANS(FormulaWithUnits("3x+1 ft")->cmp);
   21  #      ANS(FormulaWithUnits("$a*x+1 ft")->cmp);
   22  #
   23  #      $x = Formula("x");
   24  #      ANS(FormulaWithUnits($a*$x+1,"ft")->cmp);
   25  #
   26  ######################################################################
   27 
   28  #
   29  #  Now uses the version in Parser::Legacy::NumberWithUnits
   30  #  to avoid duplication of common code.
   31  #
   32 
   33 =cut
   34 
   35 sub FormulaWithUnits {Parser::Legacy::FormulaWithUnits->new(@_)}
   36 
   37 1;
   38 

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9