cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
log2.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_LOG2_H
4#define pRC_CORE_VALUE_FUNCTIONS_LOG2_H
5
6#include <cmath>
7
11
12namespace pRC
13{
14 template<class T, If<IsFloat<T>> = 0>
15 static inline constexpr auto log2(T const &a)
16 {
17 return Float(std::log2(a()));
18 }
19
20 template<class T, If<IsInteger<T>> = 0>
21 static inline constexpr auto log2(T const &a)
22 {
23 return log2(cast<Float<>>(a));
24 }
25}
26#endif // pRC_CORE_VALUE_FUNCTIONS_LOG2_H
Definition cholesky.hpp:18
static constexpr auto log2(Complex< T > const &a)
Definition log2.hpp:13
Float(Float< 16 >::Fundamental const) -> Float< 16 >
static constexpr auto cast(Complex< T > const &a)
Definition cast.hpp:13