int - Rounding to Nearest Even Number in C++ -


i wondering if c++ included way round nearest number. i've looked around , can't seem find on subject. write own method, using built-in 1 faster.

thanks.

there no built-in function this. straightforward way might like:

even = round(x / 2) * 2; 

Comments