I have such for loop and when step is (0;1) it becomes infinite. If step is [1;..) it works well.
public interface FindMinI {
double function(double x);
static double findMinOfFuncOnInterval(int begin, int end, double step, FindMinI func)
{
double min = Double.MAX_VALUE;
for (int i = begin; i <= end ; i += step) {
if(func.function(i) <= min)
min = func.function(i);
}
return min;
}
}