Go to the source code of this file.
unit test UtilFloordiv_test
Definition in file util-floordiv-test.cpp.
#include "lib/test/run.hpp"
#include "lib/util-quant.hpp"
#include "lib/util.hpp"
#include "lib/format-cout.hpp"
#include "lib/format-string.hpp"
#include <cmath>
#include <time.h>
#include <vector>
|
typedef std::vector< int > | VecI |
|
|
#define | DISPLAY_TIMINGS(ID) |
|
#define | START_TIMINGS start=clock(); |
|
|
VecI | buildTestNumberz (uint cnt) |
|
long | floordiv_alternate (long num, long den) |
| an alternate formulation, which turned out to perform slightly worse
|
|
long | integerDiv (long num, long den) |
| the built-in integer division operator, packaged as inline function for timing comparison
|
|
| LAUNCHER (UtilFloordiv_test, "unit common") |
|
|
const uint | NUM_ELMS_PERFORMANCE_TEST = 50000000 |
|
const uint | NUMBER_LIMIT = 1 << 30 |
|
◆ DISPLAY_TIMINGS
#define DISPLAY_TIMINGS |
( |
|
ID | ) |
|
Value:stop = clock(); \
cout << resultDisplay %
STRINGIFY (ID) % (double(stop-start)/CLOCKS_PER_SEC) ;
#define STRINGIFY(TOKEN)
this macro wraps its parameter into a cstring literal