Help for this page

Select Code to Download


  1. or download this
    sub p{
    @m=1;for$p(@_){my@t;for$i(0..@m){my$j;$t[$i+$j++]+=$_*$m[$i]for@$p}@m=
    +@t}[@m]
    }
    
  2. or download this
    sub p{
    @m=1;for$p(@_){my@t;for$i(0..$#m){my$j;$t[$i+$j++]+=$_*$m[$i]for@$p}@m
    +=@t}[@m]
    }
    
  3. or download this
    sub p{
      @m=1;                       # Start the product at 1.
    ...
      }                           # product.
      [@m]                        # Return our answer in the
    }                             # desired form.
    
  4. or download this
    sub p{
    @m=1;for$p(@_){my@t;for$i(0..@m){$j=$i;$t[$j++]+=$_*$m[$i]for@$p}@m=@t
    +}[@m]
    }
    
  5. or download this
    sub p{
    @m=1;for$p(@_){$i=my@t;for$,(@m){$j=$i++;$t[$j++]+=$_*$,for@$p}@m=@t}[
    +@m]
    }