[PATCH] Planner: ascent and descent rates should be rounded rather than truncated

Dirk Hohndel dirk at hohndel.org
Mon Mar 13 10:11:10 PDT 2017


On Mon, Mar 13, 2017 at 09:07:31AM -0700, Linus Torvalds wrote:
> On Mon, Mar 13, 2017 at 12:35 AM, Rick Walsh <rickmwalsh at gmail.com> wrote:
> >
> >  void PlannerSettingsWidget::setAscRate75(int rate)
> >  {
> > -       SettingsObjectWrapper::instance()->planner_settings->setAscrate75(rate * UNIT_FACTOR);
> > +       SettingsObjectWrapper::instance()->planner_settings->setAscrate75(rate * UNIT_FACTOR + 0.5);
> >  }
> 
> These should all definitely use "lrint()" rather than " + 0.5"
> together with the integer truncation.

Agreed since UNIT_FACTOR is a floating point number.

Can you send a patch / pull request that does that instead?

Thanks

/D


More information about the subsurface mailing list