AK: Relax type constraint in [ceil,floor]_div()

This commit is contained in:
Lucas CHOLLET
2025-10-30 14:49:31 +01:00
committed by Nico Weber
parent cae7c34741
commit 5d0b657d1d

View File

@@ -102,7 +102,6 @@ constexpr T mod(T const& a, IdentityType<T> const& b)
template<typename T, typename U>
constexpr T ceil_div(T a, U b)
{
static_assert(sizeof(T) == sizeof(U));
T result = a / b;
if ((a % b) != 0 && (a > 0) == (b > 0))
++result;
@@ -112,7 +111,6 @@ constexpr T ceil_div(T a, U b)
template<typename T, typename U>
constexpr T floor_div(T a, U b)
{
static_assert(sizeof(T) == sizeof(U));
T result = a / b;
if ((a % b) != 0 && (a > 0) != (b > 0))
--result;