pRC
multi-purpose Tensor Train library for C++
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{
23 template<class T, If<IsFloat<T>> = 0>
24 static inline constexpr auto trunc(T const &a)
25 {
26 return Float(std::trunc(a()));
27 }
28
39 template<class T, If<IsInteger<T>> = 0>
40 static inline constexpr auto trunc(T const &a)
41 {
42 return a;
43 }
44}
45#endif // pRC_CORE_VALUE_FUNCTIONS_TRUNC_H
Top-level class storing a floating point number.
Definition float.hpp:35
Definition cholesky.hpp:18
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
static constexpr auto trunc(Complex< T > const &a)
Definition trunc.hpp:12