cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
ceil_div.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_BASIC_FUNCTIONS_CEIL_DIV_H
4#define pRC_CORE_BASIC_FUNCTIONS_CEIL_DIV_H
5
10
11namespace pRC
12{
13 template<class TA, class TB, If<IsUnsignedIntegral<TA>> = 0,
14 If<IsUnsignedIntegral<TB>> = 0>
15 static inline constexpr auto ceilDiv(TA const a, TB const b)
16 {
17 using T = Common<TA, TB>;
18 return a % b != zero() ? a / b + unit<T>() : a / b;
19 }
20}
21#endif // pRC_CORE_BASIC_FUNCTIONS_CEIL_DIV_H
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
typename CommonTypes< Ts... >::Type Common
Definition common.hpp:55
static constexpr auto zero()
Definition zero.hpp:12
static constexpr auto ceilDiv(TA const a, TB const b)
Definition ceil_div.hpp:15