up previous next
create a new finite ring (integers mod N)
Create a new finite ring/field
ZZ/(N)
. This is
similar to
NewRingFq
, but also allows non-prime and
big integer arguments.
NOTE: calling twice
NewZZmod
will produce
two different rings, even with identical input: equality test is
performed on the pointers: see
RingID
.
/**/ p := NextProbPrime(1000000);
-- /**/ Fp := NewRingFp(p); --> !!! ERROR !!! as expected: too large
/**/ Fp := NewZZmod(p);
/**/ use Fp[x];
/**/ Characteristic(Fp);
1000003
/**/ R := NewZZmod(6);
/**/ use R[x]; -- same as "use ZZ/(6)[x];"
/**/ product([x-i | i in 1..6]);
x^6 +3*x^5 +x^4 +3*x^3 -2*x^2
/**/ use ZZ/(p)[x]; --> convenient shorthand in ring defn
/**/ (x-3)*(x-2);
x^2 +x
|