Commit 9c1f398d authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #76 from sanchom/master

Bugfix: Precision error.
parents addeb493 86dd8f74
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "precomp.hpp" #include "precomp.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/ml.hpp" #include "opencv2/ml.hpp"
#include <limits>
#include <fstream> #include <fstream>
#include <queue> #include <queue>
...@@ -1402,9 +1403,9 @@ static double NFA(int n, int k, double p, double logNT) ...@@ -1402,9 +1403,9 @@ static double NFA(int n, int k, double p, double logNT)
int i; int i;
if (p<=0) if (p<=0)
p=0.000000000000000000000000000001; p = std::numeric_limits<double>::min();
if (p>=1) if (p>=1)
p=0.999999999999999999999999999999; p = 1 - std::numeric_limits<double>::epsilon();
/* check parameters */ /* check parameters */
if( n<0 || k<0 || k>n || p<=0.0 || p>=1.0 ) if( n<0 || k<0 || k>n || p<=0.0 || p>=1.0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment