From e5fe46949e3c5e57aa659ffff7ebce8cfaab9fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 30 Dec 2016 00:18:06 +0100 Subject: [PATCH] Math: got rid of dependency in Constants.h. The tests still pass, so why not. --- src/Magnum/Math/Constants.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Magnum/Math/Constants.h b/src/Magnum/Math/Constants.h index cfa2f999d..5642f4be8 100644 --- a/src/Magnum/Math/Constants.h +++ b/src/Magnum/Math/Constants.h @@ -30,7 +30,6 @@ */ #include -#include #include "Magnum/Types.h" @@ -40,7 +39,6 @@ namespace Magnum { namespace Math { @brief Numeric constants @see @ref Magnum::Constants, @ref Magnum::Constantsd -@todo Invent a way to generate double NaN/infinity without including whole limits header */ template struct Constants { Constants() = delete; @@ -89,8 +87,8 @@ template<> struct Constants { static constexpr Double sqrt2() { return 1.414213562373095; } static constexpr Double sqrt3() { return 1.732050807568877; } - static constexpr Double nan() { return std::numeric_limits::quiet_NaN(); } - static constexpr Double inf() { return std::numeric_limits::infinity(); } + static constexpr Double nan() { return Double(NAN); } + static constexpr Double inf() { return HUGE_VAL; } }; template<> struct Constants { Constants() = delete; @@ -103,7 +101,7 @@ template<> struct Constants { static constexpr Float sqrt3() { return 1.732050808f; } static constexpr Float nan() { return NAN; } - static constexpr Float inf() { return INFINITY; } + static constexpr Float inf() { return HUGE_VALF; } }; #endif