[pygobject] Don't use == to compare doubles, use <= and =>.
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Don't use == to compare doubles, use <= and =>.
- Date: Mon, 26 Jul 2010 15:54:21 +0000 (UTC)
commit 7e9cbd5601ad548b78d106bac1a1576d33b91c65
Author: Simon van der Linden <svdlinden gnome org>
Date: Mon Jul 26 17:00:23 2010 +0200
Don't use == to compare doubles, use <= and =>.
This avoids inequality due to small precisions difference.
https://bugzilla.gnome.org/show_bug.cgi?id=625326
tests/testhelpermodule.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c
index 21679bc..5585c96 100644
--- a/tests/testhelpermodule.c
+++ b/tests/testhelpermodule.c
@@ -447,7 +447,7 @@ test4_callback (GObject *object,
g_return_if_fail (b == TRUE);
g_return_if_fail (l == 10L);
g_return_if_fail (f <= 3.14001 && f >= 3.13999);
- g_return_if_fail (d == 1.78);
+ g_return_if_fail (d <= 1.78001 && d >= 1.77999);
g_return_if_fail (uint == 20);
g_return_if_fail (ulong == 30L);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]