RPL second impressions (HP 28)
|
06-27-2018, 03:08 AM
Post: #4
|
|||
|
|||
RE: RPL second impressions (HP 28)
(06-27-2018 01:19 AM)mdunn Wrote: Algebraic: A few thoughts: - Take a look at the documentation for the IFT and IFTE commands if you really want to stick with a "load the stack first before finalizing the test" approach. There are some slight footprint and speed advantages to using those commands in certain situations, but you sacrifice some readability (IMHO) if you go that route. It's a nice option to have, though. - This applies to 48-50 RPL systems, but I'm not sure about the 28: the backquote character (`) can be used to encapsulate a clause that is automatically evaluated instead of manually evaluating it with EVAL. So in this case, you could use `FP(a/b)==0` instead of 'FP(a/b)==0' EVAL. - RPL statements that expect a boolean truth value automatically treat 0 as FALSE and any other value (positive or negative) as TRUE. This can be an advantage for size and speed in some situations. NOT can be applied to any number, which will convert 0 to 1 (TRUE), and any non-zero number to 0 (FALSE). So in this case, you could actually use a b / FP NOT in a non-algebraic clause to perform the truth test. It may or may not be as readable, but it saves space and time. Again, you get to decide which is more important. Finally, as Carsen says, experiment. Trying out various language features is the best way to learn, IMHO. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)