Commit 86dd8f74 authored by Sancho McCann's avatar Sancho McCann

Bugfix: Precision error.

When p >= 1, setting p to 0.999999999999999999999999999999, didn't actually make p less than one.
parent addeb493
......@@ -43,6 +43,7 @@
#include "precomp.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/ml.hpp"
#include <limits>
#include <fstream>
#include <queue>
......@@ -1402,9 +1403,9 @@ static double NFA(int n, int k, double p, double logNT)
int i;
if (p<=0)
p=0.000000000000000000000000000001;
p = std::numeric_limits<double>::min();
if (p>=1)
p=0.999999999999999999999999999999;
p = 1 - std::numeric_limits<double>::epsilon();
/* check parameters */
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