Power-of-two fraction handling for the 41C
|
02-01-2016, 09:36 PM
(This post was last modified: 02-01-2016 09:41 PM by Dieter.)
Post: #12
|
|||
|
|||
RE: Power-of-two fraction handling for the 41C
(02-01-2016 08:43 PM)quantalume Wrote: I took Dieter's code and added a check for the trivial case of calling the function with an integer. It now returns just the integer rather than the integer + "0/1". That's why I prefer flags here. Just clear or set e.g. flag 05 if MOD yields zero and skip the x/y output routine. (02-01-2016 08:43 PM)quantalume Wrote: I won't bother saving/recalling flags as I keep the calculator in FIX 4 most of the time anyway. Great – this avoids several problems I mentioned in my other post. Which does not mean it cannot be done... ;-) Here's a new version that uses flag 02 to switch between constant or minimized denominator, and flag 01 toggles between proper and improper fractions (in this case integer input is returned as x/1 instead of just x). Code: 01 LBL "D2F" And maybe we can also get this RCL d thing working... ;-) Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)