Skip to main content

Timeline for answer to Two's complement binary form by Matt J

Current License: CC BY-SA 2.5

Post Revisions

2 events
when toggle format what by license comment
Dec 30, 2016 at 6:28 comment added Suraj Jain If i write signed int a = -1 , then ` -1` in 2's complement form is 11111111 11111111 11111111 11111111 and then when i use %d to interpret it it prints -1 and %u , it prints 4294967295 and when i write signed int a = 2 , it prints 2 when i use %d and also when i use %u . If 2 would be in two's complement it would be 11111111 11111111 11111111 11111101 , and then it would be a very diffr answer , what i really want to ask is when does 2's complement happen is it depend on - sign or it happens for every integer if type is signed int which must not be the case here.
Mar 17, 2009 at 17:36 history answered Matt J CC BY-SA 2.5