home *** CD-ROM | disk | FTP | other *** search
- # polymod(a,b,x) give a mod b
- # similar to mod(a,b)
- # IN: polymod(x^4 + 2 x^3 - 3 x^2 - 5,x - 2, x)
- # OUT: 15
-
- polymod(a_,b_,x_) := if( order(a,x) >=1 and order(b,x)==1,
- subs(a,x=-coef(b,x,0)/coef(b,x)) )