Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Re: (Golf) Multiply polynomials

by tilly (Archbishop)
on May 08, 2001 at 15:14 UTC ( #78792=note: print w/ replies, xml ) Need Help??

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]
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://78792]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2014-10-22 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (119 votes), past polls