Commit 8e494890 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(check_one_stat): Fixed the logic that determines if we need to fix a

	rounding error.  Report the values using %g instead of %f.
parent a15c6b89
......@@ -323,11 +323,11 @@ check_one_stat(enum stat_type st,
err = acc - s->avenrun[f];
if (err < 0)
err = -err;
if ((acc < 1e-6 && err > 1e-5)
|| (acc >= 1e-6 && err / acc > 0.01))
if ((acc < 1 && err > 1e5 * acc)
|| (acc >= 1 && err / acc > 1e-5))
{
kom_log("Accumulated rounding errors fixed (%s) after"
" %ld updates (st=%d, vt=%d, f=%d, factor=%d): %f => %f\n",
" %ld updates (st=%d, vt=%d, f=%d, factor=%d): %g => %g\n",
when,
s->updates[f], st, vt, f, factors[f], s->avenrun[f], acc);
s->avenrun[f] = acc;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment