diff --git a/src/units.hh b/src/units.hh index f37dc960..2ef536d2 100644 --- a/src/units.hh +++ b/src/units.hh @@ -113,7 +113,7 @@ public: explicit constexpr operator bool() const { return m_value; } friend size_t hash_value(RealType val) { return hash_value(val.m_value); } - friend size_t abs(RealType val) { return abs(val.m_value); } + friend size_t abs(RealType val) { return val.m_value < ValueType(0) ? -val.m_value : val.m_value; } private: ValueType m_value;