Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: (Golf) Multiply polynomials

by Masem (Monsignor)
on May 07, 2001 at 18:45 UTC ( #78512=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    
    ...
    sub p {
      my$a=shift;my$b=shift;my(@c,$i,$j);for$i(0..$#$a){for$j(0..$#$b){$c[
    +$i+$j]+=$$a[$i]*$$b[$j]}};@_?p(\@c,@_):\@c
    }
    
  2. or download this
    sub p {
      my$a=shift;my$b=shift;my(@c,$i);for$i(0..$#$a){for(0..$#$b){$c[$i+$_
    +]+=$$a[$i]*$$b[$_]}};@_?p(\@c,@_):\@c
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://78512]
help
Chatterbox?
[robby_dobby]: This anonymonk's post reads weird to me
[robby_dobby]: Other than the content, that Chrome would not allow submitting code sounds like something funky going on there :P
[erix]: lazyness-driven inventio :)

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-04-25 13:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (453 votes). Check out past polls.