tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
bit_width.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  etl
 

Functions

template<etl::builtin_unsigned_integer UInt>
constexpr auto bit_width (UInt x) noexcept -> int
 If x is not zero, calculates the number of bits needed to store the value x, that is, 1+⌊log2(x)⌋. If x is zero, returns zero.