32 #include "DGtal/base/Common.h"
33 #include "DGtal/arithmetic/ModuloComputer.h"
34 #include "DGtal/kernel/NumberTraits.h"
39 using namespace DGtal;
50 unsigned int nbok = 0;
62 a = modular.
cast( 2 );
63 nbok += (a == 2) ? 1 : 0;
67 a = modular.
cast( -1 );
68 nbok += (a== 14) ? 1 : 0;
73 nbok += (a== 0) ? 1 : 0;
79 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
88 int main(
int argc,
char** argv )
92 for (
int i = 0; i < argc; ++i )
97 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
implements basic functions on modular arithmetic.
void increment(UnsignedInteger &i) const
UnsignedInteger cast(IntegerParamType i) const
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: The traits class for all models of Cinteger.
bool testModuloComputer()
int main(int argc, char **argv)