mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
33 lines
404 B
C++
33 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;
|
|
|