Fix math::clamp(x, interval) - use std::min/max as extension points
This commit is contained in:
parent
7ed67fcd41
commit
7f69077c0a
1 changed files with 3 additions and 1 deletions
|
|
@ -287,7 +287,9 @@ namespace psemek::math
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T clamp(T x, interval<T> const & i)
|
T clamp(T x, interval<T> const & i)
|
||||||
{
|
{
|
||||||
return std::max(i.min, std::min(i.max, x));
|
using std::min;
|
||||||
|
using std::max;
|
||||||
|
return max(i.min, min(i.max, x));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue