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

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

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

Revision 1071 Revision 1072
32sub _PGcomplexmacros_init { 32sub _PGcomplexmacros_init {
33} 33}
34# export functions from Complex1. 34# export functions from Complex1.
35 35
36foreach my $f (@Complex1::EXPORT) { 36foreach my $f (@Complex1::EXPORT) {
37 #PG_restricted_eval("\*$f = \*Complex1::$f"); # this is too clever -- 37# #PG_restricted_eval("\*$f = \*Complex1::$f"); # this is too clever --
38 # the original subroutines are destroyed 38 # the original subroutines are destroyed
39 next if $f eq 'sqrt'; #exporting the square root caused conflicts with the standard version 39 next if $f eq 'sqrt'; #exporting the square root caused conflicts with the standard version
40 # You can still use Complex1::sqrt to take square root of complex numbers 40 # You can still use Complex1::sqrt to take square root of complex numbers
41 next if $f eq 'log'; #exporting loq caused conflicts with the standard version 41 next if $f eq 'log'; #exporting loq caused conflicts with the standard version
42 # You can still use Complex1::log to take square root of complex numbers 42 # You can still use Complex1::log to take square root of complex numbers
47 } 47 }
48 }; 48 };
49 PG_restricted_eval($string); 49 PG_restricted_eval($string);
50} 50}
51 51
52
52# You need to add 53# You need to add
53# sub i(); # to your problem or else to dangerousMacros.pl 54# sub i(); # to your problem or else to dangerousMacros.pl
54# in order to use expressions such as 1 +3*i; 55# in order to use expressions such as 1 +3*i;
55# Without this prototype you would have to write 1+3*i(); 56# Without this prototype you would have to write 1+3*i();
56# The prototype has to be defined at compile time, but dangerousMacros.pl is complied first. 57# The prototype has to be defined at compile time, but dangerousMacros.pl is complied first.
57#Complex1::display_format('cartesian'); 58#Complex1::display_format('cartesian');
58 59
59# number format used frequently in strict prefilters 60# number format used frequently in strict prefilters
60my $number = '([+-]?)(?=\d|\.\d)\d*(\.\d*)?(E([+-]?\d+))?'; 61my $number = '([+-]?)(?=\d|\.\d)\d*(\.\d*)?(E([+-]?\d+))?';
61
62 62
63 63
64sub polar{ 64sub polar{
65 my $z = shift; 65 my $z = shift;
66 my %options = @_; 66 my %options = @_;

Legend:
Removed from v.1071  
changed lines
  Added in v.1072

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9