Commit 9eb2d39d authored by Georg Kunz's avatar Georg Kunz

[master] fixed division by zero in corner cases

parent 542b5aa5
......@@ -2882,7 +2882,13 @@ public class SequenceChart
if (low == 0 && high == 0) {
return 0; //Legacy, if no complexities are stored
}
if (debug2) Debug.println("complexity: " + complexity + " low: "+low+ " high: "+high);
if (debug2)
Debug.println("complexity: " + complexity + " low: "+low+ " high: "+high);
if (high == low)
return 1;
return ((complexity - low)*1.0) / (high - low);
}
......@@ -2892,6 +2898,10 @@ public class SequenceChart
if (low.doubleValue() == 0 && high.doubleValue() == 0) {
return 0; //Legacy, if no durations are stored
}
if (high.equals(low))
return 1;
return ((duration.doubleValue() - low.doubleValue())*1.0) / (high.doubleValue() - low.doubleValue());
}
......
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