20template <
typename LType,
typename RType>
23 static_assert(std::is_integral_v<LType>);
24 static_assert(std::is_integral_v<RType>);
26 if constexpr (std::is_unsigned_v<LType> && std::is_unsigned_v<RType>)
28 return (numerator + denominator - 1) / denominator;
32 if (numerator > 0 && denominator > 0)
34 return (numerator + denominator - 1) / denominator;
38 const auto result = numerator / denominator;
40 if (result < 0 || result * denominator == numerator)
auto RoundUpUnsafe(LType numerator, RType denominator) noexcept
Returns a rounded up integer result for numerator / denominator.