next up previous contents
Next: Factorization. Solving equations. Up: Arithmetic. Previous: Infinities.

   
Modular arithmetic

You must first store an integer n in the MODULO variable (by default n is set to 2). All computations are made modulo this integer. The kernel library provide the following commands MODADD, MODSUBT, MODMULT, MODDIV, MODPOW and MODINV for the usual operations. MODADD, MODSUBT, MODMULT, MODDIV now accepts polynomials and Gauß integers as well as integers as input. MODPOW accept polynomial as first argument, the second argument must be a positive integer.

Remark for alg48 users: these functions are analog to AADD, ASUB, ... applied to mod-polynomials (like 'MOD(X^2+3*X+7,11)') but without MOD notation. I reserve the MOD notation for a future use with a polynomial as second argument so that it will be possible to compute e.g. in $Z\!\!\!Z/3Z\!\!\!Z [X]/(X^2+1)$.



Bernard Parisse
1998-07-31