pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
fmod.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_FMOD_H
4#define pRC_CORE_VALUE_FUNCTIONS_FMOD_H
5
6#include <cmath>
7
11
12namespace pRC
13{
24 template<class TA, class TB, If<IsFloat<TA>> = 0, If<IsFloat<TB>> = 0>
25 static inline constexpr auto fmod(TA const &a, TB const &b)
26 {
27 return Float(std::fmod(a(), b()));
28 }
29
40 template<class TA, class TB, If<IsInteger<TA>> = 0, If<IsFloat<TB>> = 0>
41 static inline constexpr auto fmod(TA const &a, TB const &b)
42 {
43 return fmod(cast<Float<>>(a), b);
44 }
45
56 template<class TA, class TB, If<IsFloat<TA>> = 0, If<IsInteger<TB>> = 0>
57 static inline constexpr auto fmod(TA const &a, TB const &b)
58 {
59 return fmod(a, cast<Float<>>(b));
60 }
61
72 template<class TA, class TB, If<IsInteger<TA>> = 0, If<IsInteger<TB>> = 0>
73 static inline constexpr auto fmod(TA const &a, TB const &b)
74 {
75 return fmod(cast<Float<>>(a), cast<Float<>>(b));
76 }
77}
78#endif // pRC_CORE_VALUE_FUNCTIONS_FMOD_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 cast(Complex< T > const &a)
Definition cast.hpp:13
static constexpr auto fmod(XA &&a, XB &&b)
Calculates the floating-point remainder of an element-wise integer division of two Tensors.
Definition fmod.hpp:25