HP 50g Binary Number Formatting
|
04-23-2022, 06:50 PM
Post: #4
|
|||
|
|||
RE: HP 50g Binary Number Formatting
Easier to understand the following code, where we take every value and check if it is the 4th, the 8th,the 12th..., and when it is the case add a blank.
Code for —>BIN4c: \<< \->STR DUP DUP SIZE \-> str.ORIGIN size.ORIGIN \<< size.ORIGIN 4 MOD 4 SWAP - 4 MOD \-> m \<< m m WHILE m 0 \=/ REPEAT " " str.ORIGIN + 'str.ORIGIN' STO -1 'm' STO+ END size.ORIGIN + 1 SWAP "" UNROT FOR i str.ORIGIN i i SUB + i 4 MOD 0 == IF THEN " " + END NEXT DUP SIZE 1 - ROT 1 + SWAP SUB \>> \>> \>> |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)