32 #include "DGtal/base/Common.h"
33 #include "DGtal/math/BasicMathFunctions.h"
37 using namespace DGtal;
48 unsigned int nbok = 0;
53 trace.
info() <<
"power(5,4)= "<< functions::power(5,4) <<std::endl;
54 nbok += (functions::power(5,4)==625) ? 1 : 0;
56 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
59 trace.
info() <<
"power(5.0,4)= "<< functions::power(5.0,4) <<std::endl;
60 nbok += (functions::power(5,4)==625.0) ? 1 : 0;
62 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
68 trace.
info() <<
"roundToUpperPowerOfTwo(200)= "<< functions::roundToUpperPowerOfTwo(200) <<std::endl;
69 nbok += (functions::roundToUpperPowerOfTwo(200)==256) ? 1 : 0;
72 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
75 trace.
info() <<
"roundToUpperPowerOfTwo(1000)= "<< functions::roundToUpperPowerOfTwo(1000) <<std::endl;
76 nbok += (functions::roundToUpperPowerOfTwo(1000)==1024) ? 1 : 0;
78 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
81 trace.
info() <<
"power(5.0,4)= "<< functions::power(5.0,4) <<std::endl;
82 nbok += (functions::power(5,4)==625.0) ? 1 : 0;
84 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
95 int main(
int argc,
char** argv )
99 for (
int i = 0; i < argc; ++i )
104 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
bool testBasicMathFunctions()