bit manipulation - Fastest way to read Left-Most bit from unsigned int (C++)? -


What is the fastest way to read most bits from unsigned int?

Thanks, Online SW

  i & gt; & Gt; (Size (unsigned integer) * CHAR_BIT - 1)  

sizeof , multiplication and subtraction will be computed by any appropriate compiler at compile time, so it is a single The right-shift instruction should be made, the faster you can get it.


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -