Next: Unlimited
precision integer arithmetic Up: Commands Previous: Calculating with fractions
ALG48 can be used to perform algebraic operations on
modular polynomials, i.e., polynomials whose coefficients belong
to the finite ring generated by some positive number n, and all
the operations are performed modulo n. Usually, n
will be a prime number; in that case
is a finite field.
Modular polynomials are represented in ALG48 by regular symbolic expressions with a MOD operation at the end. E.g., `(2*X^2+5*X-1) MOD 13'.
ALG48 uses the ``symmetric'' representation when it
outputs modular polynomials, that is, it uses coefficients in the
range when the modulo is n.
All the basic operations commands AADD, ASUB, ANEG, AMUL, ADIV, AINV, and APOW, as well as the commands GCD, LCM, and RSIM can be used with modular polynomials. For instance,
When used with modular polynomials ADIV returns both the quotient (on Stack Level 2) and the remainder of the division (on Stack Level 1). E.g.,
All these commands generate a ``Bad Argument Type'' error if the expressions are not polynomials, if the moduli are not positive whole numbers, or if the moduli do not have the same value in all the arguments.