tangent icon

Equivalence of -1 and 2^32-1

tangent | PRO | 10/09/16 11:24:20 AM UTC | 0 ⭐ | 548 👁️ | Never ⏰ | []
C |

170 B

|

None

|

0 👍

/

0 👎

#include <stdio.h>
#include <stdint.h>
 
int main(void)
{
    uint32_t a = (uint32_t)(-1);
    uint32_t b = 4294967295;
    
    printf("%d\n", a - b);
    return 0;
}

Comments