mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 17:23:34 +08:00
math: support max of three values additional to min and use it everywhere
This commit is contained in:
@@ -68,6 +68,12 @@ constexpr _Tp max(_Tp a, _Tp b)
|
||||
return (a > b) ? a : b;
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
constexpr _Tp max(_Tp a, _Tp b, _Tp c)
|
||||
{
|
||||
return max(max(a, b), c);
|
||||
}
|
||||
|
||||
template<typename _Tp>
|
||||
constexpr _Tp constrain(_Tp val, _Tp min_val, _Tp max_val)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user