template<unsigned int p, class T=int> class Z;
depends on two parameters. The first one p
is the moduli, the second one T
is the type used to represent the modular numbers. By default, the internal representation is int
.
typedef Z<31> F31; F31 a("232343"), b(8); // a = 29; F31 m = a*b; // m = 15; F31 d = a/28; // d = 11; use Euclide algorithm.
synaps/arithm/Zp.h