is called the zero polynomial. For
polynomials other than the zero polynomial, the exponent of the
highest power of x with a nonzero coefficient is called the degree
of the polynomial.
New Math::Polynomial objects can be created using a variety of
constructors, or as results of expressions composed from existing objects.
Math::Polynomial objects are immutable with respect to mathematical
properties; all operations on polynomials create and return new objects
rather than modifying anything.
The module works with various types of coefficients, like ordinary
floating point numbers, complex numbers, arbitrary precision
rationals, matrices, elements of finite fields, and lots of others.
All that is required is that the coefficients are either Perl numbers
or objects with suitably overloaded arithmetic operators. Operations
on polynomials are carried out by reducing them to basic operations
in the domain of their coefficients.
Math::Polynomial objects are implicitly bound to their coefficient
space, which will be inherited when new polynomials are derived
from existing ones, or determined from actual coefficients when
polynomials are created from scratch. It is the responsibility of
the application not to mix coefficients that cannot be added to or
multiplied by each other.
Note that ordinary Perl numbers used as coefficients have the disadvantage
that rounding errors may lead to undesired effects, such as unexpectedly
non-zero division remainders or failing equality checks.
=head1 CLASS VARIABLES
=over 4
=item I<$VERSION>
C<$VERSION> contains the current version number of the module. Its
most typical use is the statement:
use Math::Polynomial 1.000;
This will make sure the module version used is at least 1.000, which
is recommended because previous versions had a different API.
=item I<$max_degree>
C<$max_degree> limits the arguments for the I .
Note that coefficients are specified in ascending order of powers
of x. The degree of the polynomial will be at most I implies that I for every I
and the linear term I<(x - c)>. The result is a polynomial that
evaluates to zero at the given root I by a linear factor
I<(x - c)>, discarding any remainder. For polynomials of degree I
by a linear factor I<(x - c)> and returns the result and remainder.
The remainder will be a zero polynomial if I ,
otherwise a constant polynomial. For polynomials of degree I , where parts below the x-axis are
regarded as negative.
For a polynomial of degree I_{ keywords.
=item C< *>
=item I
C<$p-Emul($q)> or short C<$p * $q> calculates the product of two
polynomials. For polynomials of degree I and I, this takes
I<(m+1)*(n+1)> multiplications and I additions in the coefficient
space.
=item I
C<($q, $r) = $p1-Edivmod($p2)> divides a polynomial by another
polynomial and returns the polynomial part of the quotient, and the
remainder. The second polynomial must not be a zero polynomial.
The remainder is a polynomial of lesser degree than the second
polynomial and satisfies the equation I<$p1 == $p2*$q + $r>. For
polynomials of degree I and I, I=n>, this takes I
divisions, I<(m+1-n)*n> multiplications and I<(m+1-n)*n> subtractions
in the coefficient space.
=item C
=item I}
C<$p-E and I

of a polynomial I

will be the same as I

will be chosen such that I

is the
monic greatest common divisor of I

, I