summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_types.h
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-05-20 20:55:48 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-05-20 21:46:50 +0900
commitf40a452ee140b0cdc3734eb59b4beb51d2db88d2 (patch)
treeb258ac7ff77be6f5f76999b07b9e0854a1b2cd8a /src/lib/eina/eina_types.h
parent5e95d7f2d83c1e107e44c60f1d6c27843ce280a7 (diff)
fix warnings about double/float comparisons in eina vector
this should fix T3245 this is basicall where we go double a == double b and due to precision issues this may not always be right, but this means that the equivalent now checks for "really close values" rather than perfectly exact. @fix
Diffstat (limited to 'src/lib/eina/eina_types.h')
-rw-r--r--src/lib/eina/eina_types.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/eina/eina_types.h b/src/lib/eina/eina_types.h
index 2e0c4d789f..b7bce493bd 100644
--- a/src/lib/eina/eina_types.h
+++ b/src/lib/eina/eina_types.h
@@ -410,6 +410,16 @@ typedef void (*Eina_Free_Cb)(void *data);
410#define EINA_C_ARRAY_LENGTH(arr) (sizeof(arr) / sizeof((arr)[0])) 410#define EINA_C_ARRAY_LENGTH(arr) (sizeof(arr) / sizeof((arr)[0]))
411 411
412/** 412/**
413 * @def EINA_DOUBLE_EQUAL
414 * Macro to compare 2 double floating point values and deal with precision
415 * loss issues.
416 *
417 * @since 1.18
418 */
419#define EINA_DOUBLE_EQUAL(x, y) \
420 (fabs((x) - (y)) <= (2.2204460492503131e-16) * fabs((x)))
421
422/**
413 * @} 423 * @}
414 */ 424 */
415 425