| 1 | #!/usr/local/bin/webwork-perl |
1 | |
| 2 | ########################################################## |
2 | ########################################################## |
| 3 | ## This file is PGpolynomialmacros.pl ## |
3 | ## This file is PGpolynomialmacros.pl ## |
| 4 | ## It contains rountines used to create and manipulate ## |
4 | ## It contains rountines used to create and manipulate ## |
| 5 | ## polynomials for WeBWorK ## |
5 | ## polynomials for WeBWorK ## |
| 6 | ## ## |
6 | ## ## |
| … | |
… | |
| 43 | if ($#local_x < $#local_y) { |
43 | if ($#local_x < $#local_y) { |
| 44 | while ($#local_x < $#local_y) {unshift @local_x, 0;} |
44 | while ($#local_x < $#local_y) {unshift @local_x, 0;} |
| 45 | } |
45 | } |
| 46 | elsif ($#local_y < $#local_x) { |
46 | elsif ($#local_y < $#local_x) { |
| 47 | while ($#local_y < $#local_x) {unshift @local_y, 0;} |
47 | while ($#local_y < $#local_x) {unshift @local_y, 0;} |
| 48 | } |
48 | } |
| 49 | foreach $i (0..$#local_x) { |
49 | foreach $i (0..$#local_x) { |
| 50 | $sum[$i] = $local_x[$i] + $local_y[$i]; |
50 | $sum[$i] = $local_x[$i] + $local_y[$i]; |
| 51 | } |
51 | } |
| 52 | return @sum; |
52 | return @sum; |
| 53 | } |
53 | } |