mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
34 lines
404 B
C++
34 lines
404 B
C++
#pragma once
|
|
|
|
namespace AK {
|
|
|
|
template<typename T>
|
|
inline T min(const T& a, const T& b)
|
|
{
|
|
return a < b ? a : b;
|
|
}
|
|
|
|
template<typename T>
|
|
inline T max(const T& a, const T& b)
|
|
{
|
|
return a < b ? b : a;
|
|
}
|
|
|
|
|
|
template<typename T>
|
|
static inline T ceilDiv(T a, T b)
|
|
{
|
|
T result = a / b;
|
|
if ((a % b) != 0)
|
|
++result;
|
|
return result;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
using AK::min;
|
|
using AK::max;
|
|
using AK::ceilDiv;
|
|
|