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

February 16, 2012, 17:27

congratulations nice paper, but so , i wrote about this in last yeah, in portuguese language , look this http://coolerlab.wordpress.com/2011/11/24/a-magia-dos-bits/ around of same issue that i wrote...

Comment Responses

cyanide Permalink
January 18, 2017, 00:45

I haven't read "Hacker's Delight", but all (non-obvious) tricks in you article are mentioned here.

Unfortunately, some of them, like

min = y ^ ((x ^ y) & -(x < y));
max = x ^ ((x ^ y) & -(x < y));
abs = (x ^ (x >> 31)) - (x >> 31) // For 32-bit signed int

seem to be less efficient than obvious:

min = x < y ? x: y;
max = x < y ? y: x;
abs = x < 0 ? -x: x;

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

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

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