3 ms·
((x & (INT_MAX / 2)) * 2) / 2 ?
by caf 8y ago
((x & (INT_MAX / 2)) * 2) / 2
?
- cornholio 8y agoMy version works up to x = INT_MAX and your version still fails for negative ints, so I don't see the benefit of restricting the range. Getting closer :)