Timeline for Test four int of commonality in the lower four bits
Current License: CC BY-SA 3.0
19 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 19, 2016 at 21:35 | history | notice removed | Jamal | ||
Jun 12, 2016 at 16:22 | history | edited | dbasnett | CC BY-SA 3.0 |
added 311 characters in body
|
Jun 12, 2016 at 15:06 | comment | added | Edward |
The first calculation of rslt had a typo in that (b & 15) was listed twice (second should have been (c & 15) ), but I've fixed that for you -- now it passes the test in my code and I'll soon update my timings to include the corrected version.
|
|
Jun 12, 2016 at 15:04 | history | edited | Edward | CC BY-SA 3.0 |
fixed bug in code
|
Jun 12, 2016 at 4:22 | history | edited | dbasnett | CC BY-SA 3.0 |
fix -1 check
|
Jun 11, 2016 at 15:39 | history | edited | dbasnett | CC BY-SA 3.0 |
added 37 characters in body
|
Jun 11, 2016 at 15:29 | history | edited | dbasnett | CC BY-SA 3.0 |
deleted 129 characters in body
|
Jun 11, 2016 at 15:17 | comment | added | pacmaninbw♦ | No, I'd use -1 because I can't assume one's complement or two's complement. I guess I am showing my age, of course some people would prefer octal over hex. | |
Jun 11, 2016 at 14:54 | comment | added | dbasnett | @pacmaninbw - I had the check for -1 as a comment. For us really old guys 15 = 0xf = o17 :) You'd probably write 0xffffffff instead of -1. | |
Jun 11, 2016 at 14:47 | history | edited | dbasnett | CC BY-SA 3.0 |
deleted 12 characters in body
|
Jun 11, 2016 at 14:13 | comment | added | pacmaninbw♦ | I may be wrong, but I don't see how this is checking for -1. It's not checking the MSB of the integer, the 15 is just masking the LSBs. This is a style preference, but in bit wise operations I would use 0xf over 15. | |
Jun 11, 2016 at 13:56 | history | edited | dbasnett | CC BY-SA 3.0 |
added 67 characters in body
|
Jun 11, 2016 at 13:53 | comment | added | dbasnett | My C skills aren't good. | |
Jun 11, 2016 at 13:50 | history | edited | dbasnett | CC BY-SA 3.0 |
added 67 characters in body
|
Jun 11, 2016 at 13:39 | comment | added | Jan Korous | @MaxRied Exactly :-) | |
Jun 11, 2016 at 13:38 | comment | added | bot47 |
@JanKorous Or just as return rslt; ?
|
|
Jun 11, 2016 at 13:33 | history | notice added | Simon Forsberg | Insufficient justification | |
Jun 11, 2016 at 13:31 | comment | added | Jan Korous |
I guess your last if/else could be simplified as return rslt != 0; .
|
|
Jun 11, 2016 at 13:13 | history | answered | dbasnett | CC BY-SA 3.0 |