Lumiera
0.pre.03
»edit your freedom«
|
Also known as Knuth's floor division. This function is crucial for Lumiera's rule of quantisation of time values into frame intervals. This rule requires time points to be rounded towards the next lower frame border always, irrespective of the relation to the actual time origin. Contrast this to the built-in integer division operator, which truncates towards zero.
Definition at line 103 of file util-floordiv-test.cpp.
Private Member Functions | |
virtual void | run (Arg arg) |
void | runPerformanceTest () |
void | verifyBehaviour () |
template<typename I > | |
void | verifyIntegerTypes () |
|
inlineprivate |
This test uses a sequence of random integers, where the values used as denominator are ensured not to be zero.
Verification.......... 127.7 Integer_div........... 111.7 double_floor.......... 74.8 floordiv_int.......... 112.7 floordiv_long......... 119.8 floordiv_int64_t...... 121.4 floordiv_long_alt..... 122.7
These figures are the average of 6 runs with 50 million iterations each (as produced by this function)
fdiv()
function also to divide the positive results, performs only slightly worse. So this implementation was chosen mainly because it seems to state its intent more clearly in code. Definition at line 208 of file util-floordiv-test.cpp.