, I’ve encountered a major bug in the sort function implemented within the package, which affects the possibility of using the package.
The bug is encountered in the sort method within Kolmogorov-Smirnov in the following lines (180 - 183):
if (a[n - 1] < 0)
for (int i = n - 1; a[i] < 0; i--)
data[numNegs++] = Double.longBitsToDouble(a[i]);
if (numNegs > 0)
for (int i = numNegs; i < n; i++)
data[i] = Double.longBitsToDouble(a[i - numNegs]);
Consider the case of an array including all negative numbers. In this case the first for loop will never meet a stop condition, and will run out of bound. There should be a condition verifying that the loop is within array bounds.
Same thing happens with the same for loop, in which numNegs is increased, and causes (i-numNegs) to be out of bounds.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
, I’ve encountered a major bug in the sort function implemented within the package, which affects the possibility of using the package.
The bug is encountered in the sort method within Kolmogorov-Smirnov in the following lines (180 - 183):
if (a[n - 1] < 0)
for (int i = n - 1; a[i] < 0; i--)
data[numNegs++] = Double.longBitsToDouble(a[i]);
if (numNegs > 0)
for (int i = numNegs; i < n; i++)
data[i] = Double.longBitsToDouble(a[i - numNegs]);
Consider the case of an array including all negative numbers. In this case the first for loop will never meet a stop condition, and will run out of bound. There should be a condition verifying that the loop is within array bounds.
Same thing happens with the same for loop, in which numNegs is increased, and causes (i-numNegs) to be out of bounds.
Thank you! This is fixed in version 0.3.4.