HP 50g Binary Number Formatting
|
04-24-2022, 11:59 AM
Post: #9
|
|||
|
|||
RE: HP 50g Binary Number Formatting
(04-24-2022 10:40 AM)3298 Wrote: ... Wow, every time I get ready to post a response on this thread, someone posts something that makes it look as if I were plagiarizing. I took a different view to this, mostly because I prefer to see full groups of 4 (ie. with leading zeros) instead of a shortened version for the initial digit group. In other words, I would prefer to convert #1Fh to "0001 1111" than "1 1111". My standard UserRPL version of this would seem redundant given the previous posts. So instead I'll submit a version that uses some of the ListExt library commands to shorten the code: Code: \<< Descriptions of the ListExt commands used: S→SL: Converts a string to a list of individual characters LDROP: Drops the specified quantity of list elements from a given list (positive drops from the left, negative from the right) LSDIV: Subdivides a given list into a list of sublists with the given size LMAP: Executes the given object for each list element, and returns the results as a list LXIL: (eXplode Inner Lists) replaces top-level sublists with the individual elements they contain SL→S: builds a string from the given list of characters |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)