From 39821317538c89ea49f6e3f3125a82e44b72537b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 17 Apr 2015 01:01:58 +0100 Subject: [PATCH] Fix StronglyTypedNumbers::abs --- src/units.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;