mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
AK: Relax type constraint in [ceil,floor]_div()
This commit is contained in:
committed by
Nico Weber
parent
cae7c34741
commit
5d0b657d1d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user