Timeline for Reversed Binary Numbers
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 10, 2015 at 21:21 | history | edited | ratchet freak | CC BY-SA 3.0 |
edited body
|
Jan 10, 2015 at 20:48 | comment | added | chux |
Better to use "%u" with unsigned than scanf("%d", &input);
|
|
Jan 6, 2015 at 22:21 | comment | added | Edward | Expecting other code to comply with the contract is fine. Expecting every user to do so is the recipe for fragile and exploitable software. | |
Jan 6, 2015 at 16:22 | comment | added | ratchet freak | @Edward I'm treating like it's the C spec, you give me something outside the spec you specified then anything can happen. | |
Jan 6, 2015 at 16:18 | comment | added | Edward | It should be the code that checks the contract. | |
Jan 6, 2015 at 15:55 | comment | added | ratchet freak |
@user3629249 check the contract, inputting 47 0b10111 should return 61 0b111101
|
|
Jan 6, 2015 at 15:53 | comment | added | user3629249 | this will fail when there are leading 0 bits in the input number. suggest a for loop that iterates 32 times | |
Jan 6, 2015 at 15:50 | comment | added | ratchet freak | @Edward except it's not allowed to be (see input contract) | |
Jan 6, 2015 at 15:49 | history | edited | ratchet freak | CC BY-SA 3.0 |
deleted 99 characters in body
|
Jan 6, 2015 at 15:45 | comment | added | Edward |
You might want to consider what happens if input < 0 .
|
|
Jan 6, 2015 at 15:40 | history | answered | ratchet freak | CC BY-SA 3.0 |