id summary reporter owner description type status priority milestone component version resolution keywords cc 408 Problem with EvenlyDiscretizedFunc.getXIndex(double x) Ned Field Peter Powers "This is giving inconsistent mapping for double x values that are right on bin boundaries, and it comes down to the following code: (int) Math.round((x-minX)/delta). For example, the following snippet: double minX=6.05; double delta=0.1; double[] testVals = {6,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7}; for(double x:testVals) { int index = (int)Math.round((x-minX)/delta); double binCenter = minX+delta*index; System.out.println(x+""\tindex = ""+index+""\tbinCenter=""+binCenter); } gives the following results: 6.0 index = 0 binCenter=6.05 6.1 index = 0 binCenter=6.05 6.2 index = 2 binCenter=6.25 6.3 index = 3 binCenter=6.35 6.4 index = 4 binCenter=6.45 6.5 index = 5 binCenter=6.55 6.6 index = 5 binCenter=6.55 6.7 index = 7 binCenter=6.75 6.8 index = 8 binCenter=6.85 6.9 index = 9 binCenter=6.95 7.0 index = 10 binCenter=7.05 (nothing maps to the bin with index =1, and two values map to the bin with index 5) Peter, it looks like you may have changed this bit of code from what it was originally? This should have been caught by some Junit test. " defect closed critical OpenSHA 1.3 sha fixed