Adjust model rounding behavior to avoid a potential future mystery bug
AutomatableModel::fittedValue() currently rounds values using nearbyintf(), whose behavior depends on the current rounding mode. The default rounding mode appears to be FE_TONEAREST and is not ever changed in the entire LMMS codebase, so fittedValue() has been doing the same thing as round(), but with the added possibility of exploding if someone in the future decides to call fesetround() somewhere. This PR replaces nearbyintf() with round() to be more explicit about the behavior and eliminate the possibility of any spooky action resulting from different rounding modes.
This PR also cleans up formatting and replaces two ifs with a call to clamp().
According to cppref:
If the current rounding mode is FE_TONEAREST, this function rounds to even in halfway cases (like std::rint, but unlike std::round).
So it seems there might be a behavior difference?
There is. The behavior of round() seems more sensible to me, and rint() is also dependent on the current rounding mode.