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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.5372  
changed lines
  Added in v.5373

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9