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