You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static double maxValue(double[] ary) {
return maxValue(ary,0,ary.length);
}
public static double maxValue(double[] ary, int from, int to) {
double result = ary[from];
for (int i = from+1; i<to; ++i)
if (ary[i]>result) result = ary[i];
return result;
}
Here, if the first one is NaN, it will return NaN. However, this should not be the case.
The text was updated successfully, but these errors were encountered:
maxValue is implemented as:
public static double maxValue(double[] ary) {
return maxValue(ary,0,ary.length);
}
public static double maxValue(double[] ary, int from, int to) {
double result = ary[from];
for (int i = from+1; i<to; ++i)
if (ary[i]>result) result = ary[i];
return result;
}
Here, if the first one is NaN, it will return NaN. However, this should not be the case.
The text was updated successfully, but these errors were encountered: