WPILibC++ 2023.4.3-108-ge5452e3
log2.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  internal
 

Functions

template<typename T >
constexpr return_t< T > internal::log2_check (const T x) noexcept
 
template<typename T >
constexpr return_t< T > log2 (const T x) noexcept
 Compile-time binary logarithm function. More...
 

Function Documentation

◆ log2()

template<typename T >
constexpr return_t< T > log2 ( const T  x)
constexprnoexcept

Compile-time binary logarithm function.

Parameters
xa real-valued input.
Returns
\( \log_2(x) \) using

\[ \log_{2}(x) = \frac{\log_e(x)}{\log_e(2)} \]