cMHN 1.2
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
9
10namespace pRC
11{
12 template<IsUnsignedIntegral TA, IsUnsignedIntegral TB>
13 static inline constexpr auto ceilDiv(TA const a, TB const b)
14 {
15 using T = Common<TA, TB>;
16 return a % b != zero() ? a / b + unit<T>() : a / b;
17 }
18}
19#endif // pRC_CORE_BASIC_FUNCTIONS_CEIL_DIV_H
Definition value.hpp:12
Definition cholesky.hpp:10
static constexpr auto unit()
Definition unit.hpp:13
static constexpr auto ceilDiv(TA const a, TB const b)
Definition ceil_div.hpp:13
std::common_type_t< Ts... > Common
Definition basics.hpp:53
static constexpr auto zero()
Definition zero.hpp:12