(moved to boinc_dev; code issues go here, not boinc_alpha)

That's a spurious warning.
If diff_days is zero, then weight will be 1 (== exp(0))
so that branch of the if() won't be taken.

-- David

On 23-Jun-2014 9:36 AM, Toralf Förster wrote:

I think, cppcheck is here right (around line 268), or ?


         if (diff<0) diff=0;

         diff_days = diff/SECONDS_PER_DAY;
         weight = exp(-diff*M_LN2/half_life);

         avg *= weight;

         if ((1.0-weight) > 1.e-6) {
             avg += (1-weight)*(work/diff_days); <--- Division by zero.

_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to