I want to round an unsigned integer to the immediately inferior even integer, can I divide by 2 then multiply by 2? – stackoverflow.com

For example : f(8)=8 f(9)=8 Can I do x = x/2*2; ? Is there a risk that the compiler will optimize away such expression ?

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "I want to round an unsigned integer to the immediately inferior even integer, can I divide by 2 then multiply by 2? – stackoverflow.com"