mirror of https://github.com/apache/lucene.git
LUCENE-6873: Fix numerical precision issue in SpatialTestCase.randomGaussianMeanMax
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1725057 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d231546a5f
commit
4fe23d03f2
|
@ -227,7 +227,8 @@ public abstract class SpatialTestCase extends LuceneTestCase {
|
||||||
else
|
else
|
||||||
pivotResult = Math.min(pivotMax, (g - 1) * (pivotMax - pivot) + pivot);
|
pivotResult = Math.min(pivotMax, (g - 1) * (pivotMax - pivot) + pivot);
|
||||||
|
|
||||||
return mean + flip * pivotResult;
|
double result = mean + flip * pivotResult;
|
||||||
|
return (result < 0 || result > max) ? mean : result; // due this due to computational numerical precision
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================================================= Inner Classes =================================================
|
// ================================================= Inner Classes =================================================
|
||||||
|
|
Loading…
Reference in New Issue