home *** CD-ROM | disk | FTP | other *** search
/ PC Open 13 / pcopen13.iso / Zip / SM34A.ZIP / LIBRARY / POLYMOD.LI < prev    next >
Encoding:
Text File  |  1993-04-20  |  216 b   |  8 lines

  1. # polymod(a,b,x) give a mod b
  2. # similar to mod(a,b)
  3. # IN:  polymod(x^4 + 2 x^3 - 3 x^2 - 5,x - 2, x)
  4. # OUT: 15
  5.  
  6. polymod(a_,b_,x_) := if( order(a,x) >=1 and order(b,x)==1,
  7.   subs(a,x=-coef(b,x,0)/coef(b,x)) )
  8.