Commit a72ef27e authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.cpp: float comparison with >= instead of >

The result with '>=' should be more portable.
This may be related to the actual precision of 'double' and rounding issues that may depend on the platform.

Bug detected thanks to unit tests on several slaves. Thank you Jenkins !
parent ce729325
......@@ -390,14 +390,14 @@ void KmerSegmenter::computeSegmentation(int strand, KmerAffect before, KmerAffec
evalue = evalue_left + evalue_right ;
// E-value threshold
if (threshold > NO_LIMIT_VALUE && evalue > threshold) {
if (threshold > NO_LIMIT_VALUE && evalue >= threshold) {
// Detail the unsegmentation cause
if (evalue_left > threshold && evalue_right > threshold)
if (evalue_left >= threshold && evalue_right >= threshold)
because = UNSEG_TOO_FEW_ZERO ;
else if (evalue_left > threshold)
else if (evalue_left >= threshold)
because = UNSEG_TOO_FEW_V ;
else if (evalue_right > threshold)
else if (evalue_right >= threshold)
because = UNSEG_TOO_FEW_J ;
else // left and right are <= threshold, but their sum is > threshold
because = UNSEG_TOO_FEW_ZERO ;
......
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