1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00
Files
OpenRCT2/src/core/Math.hpp
2015-09-08 21:37:24 +01:00

24 lines
304 B
C++

#pragma once
/**
* Common mathematical functions.
*/
namespace Math {
template<typename T>
T Min(T a, T b) {
return a < b ? a : b;
}
template<typename T>
T Max(T a, T b) {
return a > b ? a : b;
}
template<typename T>
T Clamp(T low, T x, T high) {
return Min(Max(low, x), high);
}
}