I link back to our posts from here:

http://mathforum.org/kb/message.jspa?messageID=7381491&tstart=0

<http://mathforum.org/kb/message.jspa?messageID=7381491&tstart=0>The next
turn of the spiral might involve taking such functions and
making them methods of a Polynomial object.

Example framework:

http://www.4dsolutions.net/ocn/python/simppoly.py

So you'd have operator overloading and write things like:

>>> p1 = Poly( {2:3, 1:4, 0:5} )
>>> p2 = Poly( {1:1, 0:5} )
>>> p1**4
>>> p1 * p2
>>> p1 + p2 etc.

Once you have polynomials as "math objects" you might
compare them with other objects that also add, multiply
etc.

Questions about closure arise i.e. what operations might
take you outside the Polynomial type for answers, etc.


<http://www.4dsolutions.net/ocn/python/simppoly.py>Kirby


On Thu, Feb 10, 2011 at 3:17 AM, Andrzej Kapanowski <ufkap...@gmail.com>wrote:

>
> Hello!
> Here is my representation of polynomials in Python as dictionaries.
>
_______________________________________________
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig

Reply via email to