32#include "DGtal/base/Common.h"
33#include "DGtal/math/BasicMathFunctions.h"
48 unsigned int nbok = 0;
51 trace.beginBlock (
"Testing power by squaring ..." );
56 trace.info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
62 trace.info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
66 trace.beginBlock (
"Testing roundToUpperPowerOfTwo ..." );
72 trace.info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
78 trace.info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
84 trace.info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
95int main(
int argc,
char** argv )
97 trace.beginBlock (
"Testing class BasicMathFunctions" );
98 trace.info() <<
"Args:";
99 for (
int i = 0; i < argc; ++i )
100 trace.info() <<
" " << argv[ i ];
101 trace.info() << endl;
104 trace.emphase() << ( res ?
"Passed." :
"Error." ) << endl;
95int main(
int argc,
char** argv ) {
…}
T power(const T &aVal, const unsigned int exponent)
T roundToUpperPowerOfTwo(const T &n)
DGtal is the top-level namespace which contains all DGtal functions and types.
bool testBasicMathFunctions()