mirror of https://github.com/AxioDL/amuse.git
Minor code formatting adjustments
This commit is contained in:
parent
89233e98b5
commit
2f4d0e7541
|
@ -81,18 +81,18 @@ static inline T clamp(T a, T val, T b)
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline T ClampFull(float in)
|
inline T ClampFull(float in)
|
||||||
{
|
{
|
||||||
if(std::is_floating_point<T>())
|
if (std::is_floating_point<T>())
|
||||||
{
|
{
|
||||||
return std::min<T>(std::max<T>(in, -1.0), 1.0);
|
return std::min<T>(std::max<T>(in, -1.f), 1.f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
constexpr T MAX = std::numeric_limits<T>::max();
|
constexpr T MAX = std::numeric_limits<T>::max();
|
||||||
constexpr T MIN = std::numeric_limits<T>::min();
|
constexpr T MIN = std::numeric_limits<T>::min();
|
||||||
|
|
||||||
if(in < MIN)
|
if (in < MIN)
|
||||||
return MIN;
|
return MIN;
|
||||||
else if(in > MAX)
|
else if (in > MAX)
|
||||||
return MAX;
|
return MAX;
|
||||||
else
|
else
|
||||||
return in;
|
return in;
|
||||||
|
|
Loading…
Reference in New Issue