[Numpy-discussion] Idea: fractional polynomial class
Charles R Harris
Fri Apr 24 13:49:36 CDT 2009
On Fri, Apr 24, 2009 at 11:09 AM, Pauli Virtanen <email@example.com> wrote:
> Fri, 24 Apr 2009 12:52:33 -0400, Michael S. Gilbert kirjoitti:
> > I've been working with numpy's poly1d class recently, and it would be
> > very useful to me if the class worked with fractions instead of floats
> > (since I'm encountering quantities that often mostly cancel out, which
> > lead to instabilities in my algorithms; hence it would be useful to use
> > fractions that don't lose precision). Since python 2.6 introduced a
> > "fractions" class, it should be fairly straightforward to
> > implement/reimplement the polynomial class with support for fractions.
> > I'm curious as to whether there would be any interest from the project
> > on this and whether you all would be open to patches/code contributions.
> Definitely, provided fractions support the usual Python operators.
> (I object to having a specialized 'fractional' polynomial class, though.)
I tend to think that this sort of thing belongs to a specialized package
like sympy or sage. The polynomial class in numpy is a quick and dirty
convenience class for numerical computation.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion