Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: (Golf) Multiply polynomials

by tilly (Archbishop)
on May 08, 2001 at 15:14 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://78792]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-20 04:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found