math - Rounding to nearest number in C++ using Boost? -


Is there a way to round the nearest number in the Boost Library?

Or is there another way to do this?

int nearest to = 5; Int result = (Input + nearest / 2) / closest * closest;

Comments