Because if you're doing the usual x%2 to check for even/oddness, your machine will do a >> operation since your mod is a power of two. This takes one cycle, just like your bit hack.
Reply To This Comment
About the site:
Peter Krumins' blog about programming, hacking, software reuse, software ideas, computer security, browserling, google and technology.
Does the odd-even trick matter?
Because if you're doing the usual x%2 to check for even/oddness, your machine will do a >> operation since your mod is a power of two. This takes one cycle, just like your bit hack.
Reply To This Comment