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;
void beginBlock(const std::string &keyword="")
bool testModuloComputer()
UnsignedInteger cast(IntegerParamType i) const
void increment(UnsignedInteger &i) const
implements basic functions on modular arithmetic.
int main(int argc, char **argv)
DGtal is the top-level namespace which contains all DGtal functions and types.