4 ms·
> Yes, this is quite well known. Sure, thanks for that Terence Tao links! I just wanted to confirm the efficiency of C notation to "see" what happens with the
by acqq 6y ago
> Yes, this is quite well known.
Sure, thanks for that Terence Tao links! I just wanted to confirm the efficiency of C notation to "see" what happens with the bits at the lowest level in this case, at least to those used to C. Now thinking about it, literal C would be even more concise:
if ( x & 1 ) x >>= 1 else x += ( x << 1 ) + 1