mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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;
|
|
|