Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
gk646 committed Apr 7, 2024
1 parent daf084e commit e39f982
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cxutil/cxmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ inline float fast_sqrt(float n) noexcept {
* @param high highest possible value
* @return low if val is smaller than low, val if val is between low and high, and high if val is bigger than high
*/
template <typename T>
template <typename T, typename std::enable_if_t<!std::is_integral<T>::value, int> = 0>
inline constexpr T clamp(const T& val, const T& low, const T& high) {
if (val < low) {
return low;
Expand All @@ -110,7 +110,7 @@ inline constexpr T clamp(const T& val, const T& low, const T& high) {
return val;
}

template <typename T, typename = std::enable_if_t<std::is_integral<T>::value>>
template <typename T, typename std::enable_if_t<std::is_integral<T>::value, int> = 0>
inline constexpr T clamp(T val, T low, T high) {
if (val < low) {
return low;
Expand All @@ -120,6 +120,7 @@ inline constexpr T clamp(T val, T low, T high) {
return val;
}


//-----------DISTANCE-----------//
inline float euclidean(float p1x, float p1y, float p2x, float p2y) noexcept {
return fast_sqrt((p2x - p1x) * (p2x - p1x) + (p2y - p1y) * (p2y - p1y));
Expand Down

0 comments on commit e39f982

Please sign in to comment.