git » libfiu » commit 08198e2

Fix probability calculation

author Alberto Bertogli
2009-03-27 05:07:00 UTC
committer Alberto Bertogli
2009-03-27 05:09:52 UTC
parent fadd14d8e3c63aef92ce94edb0377bbeec7e1be9

Fix probability calculation

As a result of this very stupid bug, probability was reversed. This patch
fixes that by fixing the comparison.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libfiu/fiu.c +1 -1

diff --git a/libfiu/fiu.c b/libfiu/fiu.c
index b1f2330..b6e8161 100644
--- a/libfiu/fiu.c
+++ b/libfiu/fiu.c
@@ -197,7 +197,7 @@ int fiu_fail(const char *name)
 				goto exit_fail;
 				break;
 			case PF_PROB:
-				if (pf->minfo.probability < drand48() )
+				if (pf->minfo.probability > drand48())
 					goto exit_fail;
 				break;
 			case PF_EXTERNAL: