Timeline for Invert the bits of a non-negative integer in Common Lisp (SBCL)
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 10, 2020 at 13:24 | history | edited | CommunityBot |
Commonmark migration
|
|
Feb 5, 2017 at 3:52 | comment | added | ben rudgers |
@GustavBertram I started to play around with a lexicographic implementation using (format nil "~b" n) etc. My answer is more about what I found interesting: the friction between the idea of flipping bits and the concepts that make Common Lisp unique. In C n might be a UBYTE . Flipping 0 produces 255 and flipping 255 produces 0. Java handles numbers in a similar vein. In Common Lisp, numbers don't seem to explicitly map into bit fields like those languages. And I found the implications in terms of information theory more interesting than my code and so I wrote that up instead.
|
|
Feb 4, 2017 at 22:38 | comment | added | Gustav Bertram | Ah, in this case reversibility is not one of the requirements. I'll be sure to link a bit more context next time to make that clear. | |
Feb 3, 2017 at 21:16 | history | edited | ben rudgers | CC BY-SA 3.0 |
added 853 characters in body
|
Feb 3, 2017 at 20:33 | history | answered | ben rudgers | CC BY-SA 3.0 |