cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
div.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_DIV_H
4#define pRC_CORE_VALUE_FUNCTIONS_DIV_H
5
10
11namespace pRC
12{
13 template<IsFloat TA, IsFloat TB>
14 static inline constexpr auto operator/(TA const &a, TB const &b)
15 {
16 return Float(a() / b());
17 }
18
19 template<IsInteger TA, IsFloat TB>
20 static inline constexpr auto operator/(TA const &a, TB const &b)
21 {
22 return cast<Float<>>(a) / b;
23 }
24
25 template<IsFloat TA, IsInteger TB>
26 static inline constexpr auto operator/(TA const &a, TB const &b)
27 {
28 return a / cast<Float<>>(b);
29 }
30
31 template<IsInteger TA, IsInteger TB>
32 static inline constexpr auto operator/(TA const &a, TB const &b)
33 {
34 return Integer(a() / b());
35 }
36}
37#endif // pRC_CORE_VALUE_FUNCTIONS_DIV_H
Definition cholesky.hpp:10
Float(Float< 16 >::Fundamental const) -> Float< 16 >
static constexpr auto cast(T const &a)
Definition cast.hpp:11
static constexpr auto operator/(Sequence< T, As... > const, Sequence< T, Bs... > const)
Definition sequence.hpp:179
Integer(Integer< true, 8 >::Fundamental const) -> Integer< true, 8 >