Lumiera  0.pre.03
»edit your freedom«
util-floordiv-test.cpp File Reference

Go to the source code of this file.

Description

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>

Classes

class  UtilFloordiv_test
 

Typedefs

typedef std::vector< int > VecI
 

Macros

#define DISPLAY_TIMINGS(ID)
 
#define START_TIMINGS   start=clock();
 

Functions

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")
 

Variables

const uint NUM_ELMS_PERFORMANCE_TEST = 50000000
 
const uint NUMBER_LIMIT = 1 << 30
 

Namespaces

Macro Definition Documentation

◆ 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
Definition: util.hpp:508