From dd6d40d75b0bf4d3a272c796f07ec7a77aea0f44 Mon Sep 17 00:00:00 2001 From: Kimmo Hoikka Date: Mon, 10 Aug 2015 16:01:12 +0100 Subject: [PATCH] Change Epsilon 0 and 1 to use the compiler provided values Change-Id: I68cb4b0fe5c965c47560a46aa5575836b8f5743c --- dali/public-api/math/compile-time-math.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dali/public-api/math/compile-time-math.h b/dali/public-api/math/compile-time-math.h index fbe244a..a0f506d 100644 --- a/dali/public-api/math/compile-time-math.h +++ b/dali/public-api/math/compile-time-math.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -126,15 +127,14 @@ struct Epsilon * @brief Compile time template to calculate the machine epsilon for a given floating point number. * * Specialisation for epsilon of 1 - * predefined value calculated on ARM Cortex A9 target */ template<> struct Epsilon< 1 > { #ifdef _CPP11 - static constexpr float value = 1.19209e-07f; + static constexpr float value = FLT_EPSILON; #else - static const float value = 1.19209e-07f; + static const float value = FLT_EPSILON; #endif }; @@ -142,15 +142,14 @@ struct Epsilon< 1 > * @brief Compile time template to calculate the machine epsilon for a given floating point number. * * Specialisation for epsilon of 0 - * predefined value calculated on ARM Cortex A9 target */ template<> struct Epsilon< 0 > { #ifdef _CPP11 - static constexpr float value = 1.4013e-45f; + static constexpr float value = FLT_MIN; #else - static const float value = 1.4013e-45f; + static const float value = FLT_MIN; #endif }; -- 2.7.4