title: ERROR: Control may reach end of non-void function /
body: <p>Don't understand why i'm getting the warning that "Control may reach end of non-void function." Any suggestions?</p>
  
  <p>Here is my code:</p>
  
  <pre><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&lt;double&gt;dist(0,1);
  
      for(int i = 0; i&lt; reps ;i++){
          x = dist(engine);
          y = dist(engine);
          pythag_sum = (x*x)+(y*y);
          if (pythag_sum &lt;= 1){
              inside += pythag_sum;
              total += pythag_sum;
          }
          else {
              total += pythag_sum;
           }
       return (inside/total)/10;
       }
  }
  </code></pre>