summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-01-06 11:18:49 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-01-06 15:58:46 -0800
commit89f429c0e7c7b71916230a6634d061dae7457db1 (patch)
treecd66c0a221f179d5af3896727e2923ce1211f644 /src/lib/eina
parent8f1c071d6adbf6f8e2002eeeabdc7f3d7be9ef22 (diff)
eina: switch to equal FP_ZERO with fpclassify.
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_util.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/eina/eina_util.h b/src/lib/eina/eina_util.h
index ef3089ed4b..e0b27c6c89 100644
--- a/src/lib/eina/eina_util.h
+++ b/src/lib/eina/eina_util.h
@@ -20,6 +20,7 @@
20#define EINA_UTIL_H_ 20#define EINA_UTIL_H_
21 21
22#include <float.h> 22#include <float.h>
23#include <math.h>
23 24
24/** 25/**
25 * @addtogroup Eina_Tools_Group Tools 26 * @addtogroup Eina_Tools_Group Tools
@@ -80,13 +81,13 @@ EAPI Eina_Bool eina_flteq(float a, float b);
80#define EINA_FLT_EQ(a, b) (!!(fabsf((float)a - (float)b) <= FLT_EPSILON)) 81#define EINA_FLT_EQ(a, b) (!!(fabsf((float)a - (float)b) <= FLT_EPSILON))
81 82
82/** 83/**
83 * @brief Determine if a float is nonzero 84 * @brief Determine if a float is not zero
84 * @param a The float 85 * @param a The float
85 * 86 *
86 * @return @c true if float is nonzero 87 * @return @c true if float is not zero
87 * @since 1.19 88 * @since 1.19
88 */ 89 */
89#define EINA_FLT_NONZERO(a) (!EINA_FLT_CMP((a), 0.0)) 90#define EINA_FLT_NONZERO(a) (!!(fpclassify((float)(a)) != FP_ZERO))
90 91
91/** 92/**
92 * @brief Safe comparison of double 93 * @brief Safe comparison of double
@@ -99,13 +100,13 @@ EAPI Eina_Bool eina_flteq(float a, float b);
99#define EINA_DBL_EQ(a, b) (!!(fabs((double)a - (double)b) <= DBL_EPSILON)) 100#define EINA_DBL_EQ(a, b) (!!(fabs((double)a - (double)b) <= DBL_EPSILON))
100 101
101/** 102/**
102 * @brief Determine if a double is nonzero 103 * @brief Determine if a double is not zero
103 * @param a The double 104 * @param a The double
104 * 105 *
105 * @return @c true if double is nonzero 106 * @return @c true if double is not zero
106 * @since 1.19 107 * @since 1.19
107 */ 108 */
108#define EINA_DBL_NONZERO(a) (!EINA_DBL_CMP((a), 0.0)) 109#define EINA_DBL_NONZERO(a) (!!(fpclassify((double)(a)) != FP_ZERO))
109 110
110/** 111/**
111 * @} 112 * @}