My favorite short RPL program


Hi! I'm new to this forum, and joined partly to take advantage of the classified ADs. But here is a short RPL program that I think is pretty cool, notwithstanding that it is already implemented as a built-in command in my calculator.

The Euclidean algorithm for finding the greatest common divisor of two integers is recursive. GCDx calls itself:


I like this because in one very short program you have a natural implementation of an algorithm that is naturally recursive, using the IFTE command to either halt or continue the recursion, and using lists instead of embedded programs for the arguments to IFTE.

I have written a book, which is a user's guide for the 48g/49g/50 series. If you are interested, there is more information in the classified ads section, or at least I hope that there will be as soon as the moderator has approved it.


I was able to have a quick flick-through Wlodek's copy at the HPCC Club meeting in London yesterday. While by no means a review, my immediate impressions were positive:

  • It's a good book for a newcomer to the machine. It seems to strike the right balance between being short-enough (and therefore thin enough) not to deter readers, but containing enough information and detail to be useful.
  • It's good that new books about the 50G are coming out. The User Guide, with its need to cover what rapidly becomes trivial and second-nature to the user, can be too dry to learn from. Just having an alternate point of view makes all the difference as a few key topics can be presented in a bit more detail. The book also adds weight to the 50G as a machine - it's not just an HP product but something that is actively supported by the marketplace.



I am experiencing a mixed reaction to your comments. On the one hand, I appreciate that your overall impressions were “positive”, which is manifestly better than the alternative. On the other hand, I was a little surprised to see a summary opinion volunteered in a moderately peremptory manner by someone whose experience with the book amounts to a “quick flick-through”. I stumbled over the phrasing, and was unsure whether you intended to relegate in total the material that I covered to the status of material that “rapidly becomes trivial and second-nature to the user”. I eventually decided that you possibly did not mean that exactly, but I could never decide what to make of the last phrase of that sentence, i.e., “too dry to learn from”.

An accurate, matter-of-fact characterization of my book would be to say that it is very carefully written and unusually thorough in its treatment of those essential features that are within the scope of the undertaking. There is no question that many experienced users will find a significant portion of it downright boring. Yet, I have confidence that many, perhaps the majority, of experienced users will nevertheless find my book useful and desirable, for any of several reasons. The treatment that I give, to many specific topics, is so much more complete than that available elsewhere, that many experienced users may discover a useful improvement to their understanding of various topics. Experienced users who do not sleep with their calculator under their pillow and who forget how to use certain essential features of the calculator from time to time, will appreciate a narrative explanation that is handy and that will quickly refresh their memory of how to use those essential features.

Genuine experts such as you excluded, users in general and novice users in particular who find themselves dissatisfied with the smattering of knowledge offered by the standard manuals, will likely appreciate the thorough, exact presentation that offers a fast track to gaining intimate familiarity with the use of the calculator. (And if there is one craving that we all share, it is the desire to be intimate with our calculators.)

If the moderators are inclined to indulge me, I will provide an excerpt or two, so that anyone who happens to be curious, will be better able to make an informed opinion as to whether it is likely to be useful to them. Since this forum is mostly attended by people who would be bored with any excerpt that only novice users could appreciate, I will endeavor to avoid that in the excerpts, even though that risks giving novice users the impression that the book will be over their heads.

The first excerpt will deal with the CAS modes Numeric and Approx, and will appear in a post following this one.



Edited: 10 Sept 2006, 10:42 p.m.


Tom, Bruce can no doubt tell us his intention however my original reading of the phrases that trouble you connected them to the HP-supplied User Guide. I took his meaning to be that your offering served to counter the drawback's of a generic user guide.

I re-read Bruce's posting after I read your reaction to it. My original interpretation is unchanged.

Just one reader's observation.



I agree with Cameron Bruce is clearly referring to the HP supplied manuals as having by necesitty to cover the basics which become second nature and to be too dry to learn from, not your book.

I appreciate what you're doing and see the need for it; back in the old days HP manuals were as well designed as the calculators, and matched their sophistication where necessary. As the calculators became more sophisticated it seemed HP was unwilling to put forth the effort necessary to preserve that tradition. Bill Wickes' books went a long way toward solving that problem for the 28/48 but when the 49 came out the problem got far ahead of the solution.

I've read your excerpts and they're excellent. I think this book will be like finding a paved road in a jungle for many 49/50 users and potential users. I'm much more likely to buy a 50g now that I know there's a source of accurate thorough and concise information to help me along. Thanks for the effort it took to do it.


Tom: you have misunderstood my point. It is the User Guide that I said was too dry to learn from. This is not to disparage HP's efforts, it is merely to point out an inevitable aspect of any user guide, which is that a user guide is required to explain every little point to a new user. Once a user is no longer "new" then going back over the same basic material, in order to glean new information that was missed first or second time through, is tiresome. In short: the reward from re-reading a user guide does not justify the effort.

This is where your book comes in: you've made that effort on behalf of the user and distilled all the important information into a much more concise format. I'm pleased that you've posted excerpts so that people can see for themselves and I have to say I agree wholeheartedly with Steve's "paved road in a jungle" analogy. If only I'd thought of that phrase then it would have saved this thread!

My thanks to Cameron and Steve for leaping to my defence so quickly.



I may have hit a glitch in the forum software because when I try to respond to your ad by email, I get a funny message telling me that my ad is not complete and I have to post my address, etc etc.

Anyway, I am interested in the book (per your ad). Please email the information at j cadick at cadick . com. Make the obvious changes.


Edited: 11 Sept 2006, 9:36 a.m.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Writing RPL programs on OS X Sean Freeman 18 5,073 11-30-2013, 03:59 PM
Last Post: Sean Freeman
  HP Prime - Short "learning" modules CR Haeger 1 1,337 11-27-2013, 02:13 PM
Last Post: Jonathan Cameron
  I have written a short introduction to the HP Prime Michael Carey 7 2,763 11-18-2013, 08:04 PM
Last Post: Michael Carey
  48G vs 49G+ User RPL Speed Comparison John Colvin 7 2,553 11-16-2013, 10:07 PM
Last Post: Han
  HP Prime - most favorite command bluesun08 2 1,455 11-12-2013, 11:29 AM
Last Post: bluesun08
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,645 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  RPL 32 David Hayden 4 2,044 11-11-2013, 11:34 AM
Last Post: David Hayden
  HP-65 short circuit Ignacio Sánchez 2 1,529 10-22-2013, 08:27 AM
Last Post: Ignacio Sánchez Reig
  HHC / HP Museum Programming Contest for RPN and RPL machines Gene Wright 18 5,474 09-22-2013, 09:39 AM
Last Post: Miguel Toro
  HP-41 New versions of your favorite modules - with an AOS twist :-) Ángel Martin 13 6,646 06-21-2013, 01:29 PM
Last Post: Diego Diaz

Forum Jump: