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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -