I found this in Hackers Delight, you would need to change it for long long though.
You could also #define that as a macro.Code:((x) >> 30) | 1) * x
I found this in Hackers Delight, you would need to change it for long long though.
You could also #define that as a macro.Code:((x) >> 30) | 1) * x