+ if (PREDICT_FALSE (c->round_to_units == 0.0))
+ {
+ f64 next_pow10, est_round_to_units;
+ /*
+ * Compute the first power of ten which is greater than
+ * 0.1% of the new clock rate. Save the result, and use it
+ * to round future results, so we don't end up calculating
+ * silly-looking clock rates.
+ */
+ est_round_to_units = ((f64) dtc / dtr) * 0.001;
+ next_pow10 = ceil (log10 (est_round_to_units));
+ c->round_to_units = pow (10.0, next_pow10);
+ }
+