Post Reply 
Companion program for Joe Horn’s continued fractions article
09-09-2023, 08:37 AM
Post: #1
Companion program for Joe Horn’s continued fractions article
Hi

This is a companion program for Joe Horn’s article on continued fractions.

Code:

« → a b
  « a →SF →CF b →SF →CF → c d
    « { }
      DO
        IF c HEAD d HEAD DUP2 ≠
        THEN MIN 1 +
        ELSE DROP
        END + c HEAD d HEAD c TAIL 'c' STO d TAIL 'd' STO
      UNTIL ≠
      END CF→
    »
  »
»

You’ll need to type I the programs from the article too.
Give this program two decimal fractions according to the article, and you’ll get back the smallest fraction that evaluates between them.

The article itself can be found here: https://www.hpmuseum.org/forum/thread-7984.html

2xHP48GX, HP 50g, two Retrotronik ram cards, DM42
/Daniel Lidström
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Companion program for Joe Horn’s continued fractions article - dlidstrom - 09-09-2023 08:37 AM



User(s) browsing this thread: 1 Guest(s)