FEHLER: Steuerung erreicht Ende von nicht-void-Funktion /

Verstehe nicht, warum ich bin immer die Warnung, dass "die Kontrolle kann erreicht Ende von nicht-void-Funktion." Irgendwelche Vorschläge?

Hier ist mein code:

long double geo_fn(long reps, int seed) {
    double x, y, pythag_sum, total = 0, inside = 0;
    default_random_engine engine(seed);             
    uniform_real_distribution<double>dist(0,1);

    for(int i = 0; i< reps ;i++){
        x = dist(engine);
        y = dist(engine);
        pythag_sum = (x*x)+(y*y);
        if (pythag_sum <= 1){
            inside += pythag_sum;
            total += pythag_sum;
        }
        else {
            total += pythag_sum;
         }
     return (inside/total)/10;
     }
}

InformationsquelleAutor Tyler | 2013-09-30

Schreibe einen Kommentar