You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <algorithm>
|
|
|
|
// https://stackoverflow.com/questions/9323903/most-efficient-elegant-way-to-clip-a-number
|
|
template <typename T>
|
|
T clip(const T& n, const T& lower, const T& upper) {
|
|
return std::max(lower, std::min(n, upper));
|
|
}
|
|
|