Recently I had hit upon a document on efficient C optimisations... most of them are bit manipulation operations
as i was going thro' the doc. i'd some doubts.. cud the experts throw some light on these
1) (x+y) equals ((x&y)+(x|y)) equals ((x^y)+2*(x&y)). How is this possible
2) Given 2's complement integer values x and y, the minimum can be computed without any branches
as x+(((y-x)>>(WORDBITS-1))&(y-x)). how can they arrive on this
3) Similarly Given a 2's complement binary integer value x, (x&-x) is the least significant 1 bit.
It s not any Home work question(S).
I can provide the doc. if reqd.