mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 03:23:15 +01:00
24 lines
304 B
C++
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);
|
|
}
|
|
|
|
}
|