[system] / trunk / pg / lib / Parser / BOP / power.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Parser/BOP/power.pm

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

Revision 5330 Revision 5331
46 my $self = shift; my $equation = $self->{equation}; 46 my $self = shift; my $equation = $self->{equation};
47 my $reduce = $equation->{context}{reduction}; 47 my $reduce = $equation->{context}{reduction};
48 return $self->Item("Number")->new($equation,1) 48 return $self->Item("Number")->new($equation,1)
49 if (($self->{rop}{isZero} && !$self->{lop}{isZero} && $reduce->{'x^0'}) || 49 if (($self->{rop}{isZero} && !$self->{lop}{isZero} && $reduce->{'x^0'}) ||
50 ($self->{lop}{isOne} && $reduce->{'1^x'})); 50 ($self->{lop}{isOne} && $reduce->{'1^x'}));
51 return $self->{lop} if ($self->{rop}{isOne}); 51 return $self->{lop} if $self->{rop}{isOne} && $reduce->{'x^1'};
52 if ($self->{rop}->isNeg && $self->{rop}->string eq '-1' && $reduce->{'x^(-1)'}) { 52 if ($self->{rop}->isNeg && $self->{rop}->string eq '-1' && $reduce->{'x^(-1)'}) {
53 $self = $self->Item("BOP")->new($equation,'/',$self->Item("Number")->new($equation,1),$self->{lop}); 53 $self = $self->Item("BOP")->new($equation,'/',$self->Item("Number")->new($equation,1),$self->{lop});
54 $self = $self->reduce; 54 $self = $self->reduce;
55 } 55 }
56 return $self; 56 return $self;
57} 57}
58 58
59$Parser::reduce->{'x^0'} = 1; 59$Parser::reduce->{'x^0'} = 1;
60$Parser::reduce->{'1^x'} = 1; 60$Parser::reduce->{'1^x'} = 1;
61$Parser::reduce->{'x^(-1)'} = 1; 61$Parser::reduce->{'x^(-1)'} = 1;
62$Parser::reduce->{'x^1'} = 1;
62 63
63 64
64# 65#
65# Put exponent in braces for TeX 66# Put exponent in braces for TeX
66# 67#

Legend:
Removed from v.5330  
changed lines
  Added in v.5331

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9