Compute the integer base‐2 logarithm of a value.

Synopsis

Declared in <folly/ConstexprMath.h>

template<typename T>
constexpr
T
constexpr_log2(T t);

Return Value

The floor of the base‐2 logarithm of t.

Parameters

Name

Description

t

The value whose base‐2 logarithm is computed.

Created with MrDocs