Add fuzzy floating point comparison macro

Add a test macro that allows comparing two floating point values for
equality within a certain tolerance.

This macro has been independently reimplemented by various projects:

 * Clutter
 * Graphene
 * colord

https://gitlab.gnome.org/GNOME/glib/issues/914
This commit is contained in:
Emmanuele Bassi
2017-02-08 17:20:41 +00:00
parent 24e98e38d6
commit 0b4c2eefce
4 changed files with 44 additions and 4 deletions

View File

@@ -3147,6 +3147,7 @@ g_assert_cmpint
g_assert_cmpuint
g_assert_cmphex
g_assert_cmpfloat
g_assert_cmpfloat_with_epsilon
g_assert_cmpmem
g_assert_no_error
g_assert_error