STXXL
1.4.0
|
STXXL provides three methods to calculate log2(x), which is often needed for binary trees, etc.
The first is during compile-time using template meta-programming magic:
The second is for calculating log2(x) for integer arguments using simple bit shift arithmetic:
The third and probably least useful is to use conversion to double and math.h's
facilities: