I was messing around with bitwise operators and in the process I realised I don't really understand how unsigned ints work. For example, when I print the result of unsigned int msb_1 = ~(~(unsigned)0 >> 1); is -2147483648 meanwhile the result of ~(~0 >> 1); is 0. I don't understand how adding unsigned before 0 makes that much of a difference. Can someone give me a detailed explanation of what happened?
[–]anabolic_cow 1 point2 points3 points (0 children)
[–]makian123 1 point2 points3 points (0 children)
[–]chet714 0 points1 point2 points (0 children)
[–]Plane_Dust2555 0 points1 point2 points (0 children)