discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=16d28c6bc8d49e30afb3ee66730ddf3a50494147
commit 16d28c6bc8d49e30afb3ee66730ddf3a50494147 Author: Mike Blumenkrantz <zm...@osg.samsung.com> Date: Fri Jan 6 12:57:46 2017 -0500 eina: add macros for determining whether floats are nonzero this is a commonly-used functionality, so make it faster to write @feature --- src/lib/eina/eina_util.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lib/eina/eina_util.h b/src/lib/eina/eina_util.h index 3796dcb..fab9617 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); #define EINA_FLT_CMP(a, b) (fabsf((float)a - (float)b) <= FLT_EPSILON) /** + * @brief Determine if a float is nonzero + * @param a The float + * + * @return @c true if float is nonzero + * @since 1.19 + */ +#define EINA_FLT_NONZERO(a) (!EINA_FLT_CMP((a), 0.0)) + +/** * @brief Safe comparison of double * @param a First member to compar * @param b Second member to compar @@ -88,6 +97,15 @@ EAPI Eina_Bool eina_flteq(float a, float b); #define EINA_DBL_CMP(a, b) (fabs((double)a - (double)b) <= DBL_EPSILON) /** + * @brief Determine if a double is nonzero + * @param a The double + * + * @return @c true if double is nonzero + * @since 1.19 + */ +#define EINA_DBL_NONZERO(a) (!EINA_DBL_CMP((a), 0.0)) + +/** * @} */ --