summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-01-06 12:57:46 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-01-06 12:57:08 -0500
commit16d28c6bc8d49e30afb3ee66730ddf3a50494147 (patch)
treefb1eacf894f61d02dff51240e8dd2adfce47581e /src/lib/eina
parent1b4c26be8e9630ae0c367b914f893161c968799a (diff)
eina: add macros for determining whether floats are nonzero
this is a commonly-used functionality, so make it faster to write @feature
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_util.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/eina/eina_util.h b/src/lib/eina/eina_util.h
index 3796dcb392..fab96177d7 100644
--- a/src/lib/eina/eina_util.h
+++ b/src/lib/eina/eina_util.h
@@ -79,6 +79,15 @@ EAPI Eina_Bool eina_flteq(float a, float b);
79#define EINA_FLT_CMP(a, b) (fabsf((float)a - (float)b) <= FLT_EPSILON) 79#define EINA_FLT_CMP(a, b) (fabsf((float)a - (float)b) <= FLT_EPSILON)
80 80
81/** 81/**
82 * @brief Determine if a float is nonzero
83 * @param a The float
84 *
85 * @return @c true if float is nonzero
86 * @since 1.19
87 */
88#define EINA_FLT_NONZERO(a) (!EINA_FLT_CMP((a), 0.0))
89
90/**
82 * @brief Safe comparison of double 91 * @brief Safe comparison of double
83 * @param a First member to compar 92 * @param a First member to compar
84 * @param b Second member to compar 93 * @param b Second member to compar
@@ -88,6 +97,15 @@ EAPI Eina_Bool eina_flteq(float a, float b);
88#define EINA_DBL_CMP(a, b) (fabs((double)a - (double)b) <= DBL_EPSILON) 97#define EINA_DBL_CMP(a, b) (fabs((double)a - (double)b) <= DBL_EPSILON)
89 98
90/** 99/**
100 * @brief Determine if a double is nonzero
101 * @param a The double
102 *
103 * @return @c true if double is nonzero
104 * @since 1.19
105 */
106#define EINA_DBL_NONZERO(a) (!EINA_DBL_CMP((a), 0.0))
107
108/**
91 * @} 109 * @}
92 */ 110 */
93 111