nearbyint optimization (only clear inexact when necessary)