[system] / trunk / pg / macros / Value.pl Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/pg/macros/Value.pl

Wed Aug 11 18:02:44 2004 UTC (15 years, 6 months ago) by dpvc
File size: 1004 byte(s)
```Added Real() command to create fuzzy reals.
```

```    1 ###########################################################################
2 #
3 #  Declares functions needed for Value.pm
4 #
5
6 #
7 #  Constructors for the various types
8 #
9 sub Real     {Value::Real->new(@_)}
10 sub Complex  {Value::Complex->new(@_)}
11 sub Point    {Value::Point->new(@_)}
12 sub Vector   {Value::Vector->new(@_)}
13 sub Matrix   {Value::Matrix->new(@_)}
14 sub List     {Value::List->new(@_)}
15 sub Interval {Value::Interval->new(@_)}
16 sub Union    {Value::Union->new(@_)}
17
18 # sub Formula  {Value::Formula->new(@_)}
19 #
20 # #
21 # #  Parse a formula and evaluate it
22 # #
23 # sub Compute {
24 #   my \$formula = Formula(shift);
25 #   return \$formula->eval(@_);
26 # }
27
28 ###########################################################################
29 #
30 #  Make it possible to use  1+3*i  in perl rather than  1+3*\$i or 1+3*i()
31 #
32 #sub i ()  {Value::Complex->i};   #  defined in Parser.pl
33 #sub pi () {Value::Complex->pi};  #  defined in dangerousMacros.pl
34
35 ###########################################################################
36
37 1;
```