You're viewing a comment by cassandra and its responses.

cassandra Permalink
September 14, 2010, 21:20

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.

Comment Responses

cyanide Permalink
January 18, 2017, 01:00

Why should we rely on compiler optimization? If I see x%2 instead of (x&1) I feel like something written by a non-professional.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "server_143": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.