added operator %
This commit is contained in:
parent
ac9719ad57
commit
15cf3dcafb
2
rpn
2
rpn
|
@ -10,7 +10,7 @@ my $stack_color = 'blue';
|
||||||
print color $input_color;
|
print color $input_color;
|
||||||
while (<>) {
|
while (<>) {
|
||||||
for (split) {
|
for (split) {
|
||||||
if (m{^[-+*/]|\*\*$}) {
|
if (m{^[-+*/%]|\*\*$}) {
|
||||||
my $y = pop @stack;
|
my $y = pop @stack;
|
||||||
my $x = pop @stack;
|
my $x = pop @stack;
|
||||||
my $z = eval "$x $_ $y";
|
my $z = eval "$x $_ $y";
|
||||||
|
|
Loading…
Reference in New Issue