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

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -