Companion program for Joe Horn’s continued fractions article
|
09-13-2023, 11:07 AM
(This post was last modified: 09-14-2023 04:55 AM by dlidstrom.)
Post: #7
|
|||
|
|||
RE: Companion program for Joe Horn’s continued fractions article
(09-10-2023 12:50 AM)Joe Horn Wrote: I hate to make your life more difficult, but another issue arises when the best fraction is one of the inputs. Sometimes your program returns that fraction, but other times not. For example: This turned out to be much more difficult than I thought. My initial program was small and fast but wrong. Now it has ballooned. But I've tried my best to come up with a more complete program. I say more complete because I'm sure there are issues I haven't thought of or understood completely. Arbitrarily I decided the program can return in the interval (A, B]. That is, it is allowed to return the smallest decimal as the simplest fraction but not the largest decimal. There are some cases which aren't covered. Such as equal decimals being supplied, and perhaps negative decimals. However, I think I'll leave it here. Code:
2xHP48GX, HP 50g, two Retrotronik ram cards, DM42 /Daniel Lidström |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)