fix usage of std::rint for older compilers