Gromacs  2018.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Static Public Attributes
gmx::StaticLog2< 0 > Struct Template Reference

#include <gromacs/math/functions.h>


struct gmx::StaticLog2< 0 >

Specialization of StaticLog2<n> for n==0.

This specialization should never actually be used since log2(0) is negative infinity. However, since Log2() is often used to calculate the number of bits needed for a number, we might be using the value 0 with a conditional statement around the logarithm. Depending on the compiler the expansion of the template can occur before the conditional statement, so to avoid infinite recursion we need a specialization for the case n==0.

Static Public Attributes

static const int value = -1
 Base value for recursive static calculation of Log2(int)

The documentation for this struct was generated from the following file: