[Edu-sig] Algebra + Python

Kirby Urner pdx4d@teleport.com
Mon, 30 Apr 2001 23:44:15 -0700


I elaborated on Brent's excellent suggestion for a post to k12.ed.math 
(which you can check via http://www.mathforum.com/epigone/k12.ed.math/ ).

The Poly objects are in play:

  >>> f = Poly([2,3,4])
  >>> f
  Polynomial: 2*x**2 + 3*x + 4
  >>> f(10)
  234
  >>> f.degree
  2
  >>> f.deriv()
  Polynomial: 4*x + 3
  >>> df = f.deriv()
  >>> df(10)
  43
  >>> g = Poly([-1,0,0,2])
  >>> g
  Polynomial: -1*x**3 + 2
  >>> g(-1)
  3
  >>> dg = g.deriv()
  >>> dg
  Polynomial: -3*x**2
  >>> dg(-1)
  -3

Kirby