lunedì, ottobre 23, 2006

reiezione, 3


double randFunc(double func(double),
double minx, double maxx,
double miny, double maxy) {
if (maxx < minx) return maxx - 1 ;
if (maxy < miny) return minx - 1 ;
double output = minx - 1 ;
while (output < minx) {
double x = randFlat(minx, maxx) ;
double y = randFlat(miny, maxy*1.0001) ;
if (func(x) > y) output = x ;
}
return output ;
}



Nessun commento: