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

View of /trunk/pg/macros/parserNumberWithUnits.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: 876 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 loadMacros('MathObjects.pl');
    2 
    3 sub _parserNumberWithUnits_init {}; # don't reload this file
    4 
    5 =head1 DESCRIPTION
    6 
    7  ######################################################################
    8  #
    9  #  This is a Parser class that implements a number with units.
   10  #  It is a temporary version until the Parser can handle it
   11  #  directly.
   12  #
   13  #  Use NumberWithUnits("num units") or NumberWithUnits(formula,"units")
   14  #  to generate a NumberWithUnits object, and then call its cmp method
   15  #  to get an answer checker for your number with units.
   16  #
   17  #  Usage examples:
   18  #
   19  #      ANS(NumberWithUnits("3 ft")->cmp);
   20  #      ANS(NumberWithUnits("$a*$b ft")->cmp);
   21  #      ANS(NumberWithUnits($a*$b,"ft")->cmp);
   22  #
   23 
   24  #
   25  #  We now call on the Legacy version, which is used by
   26  #  num_cmp to handle numbers with units.
   27  #
   28 
   29 =cut
   30 
   31 sub NumberWithUnits {Parser::Legacy::NumberWithUnits->new(@_)}
   32 
   33 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9