Evolution of Conditional Tests - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: Evolution of Conditional Tests (/thread-14307.html) Evolution of Conditional Tests - David Hayden - 01-03-2020 09:28 PM I noticed recently that the conditional tests available on the programmable models changed over the years. Here they are in roughly chronological order from the 65 to the 15C: Code: ```    xy x>0  x>=y x>=0  x!=y x!=0  x=y x=0 65             Y         Y                    Y         Y 55             Y                                        Y 67       Y     Y         Y   Y                Y    Y    Y   Y   ( x=y and x=0 added thanks to Dave Britten's reply below.) 25   Y   Y                         Y    Y     Y    Y    Y   Y 29C      Y     Y         Y   Y                Y    Y    Y   Y 33C      Y     Y         Y   Y                Y    Y    Y   Y 34C      Y     Y         Y   Y                Y    Y    Y   Y 38C            Y                                            Y 41C  Y   Y     Y    Y    Y   Y                Y    Y    Y   Y 10C            Y                                            Y 11C      Y     Y         Y   Y                Y    Y    Y   Y 15C  Y   Y     Y    Y    Y   Y     Y    Y     Y    Y    Y   Y``` It's particularly interesting to me to see how things changed from the 67 to the 25 to the 29C. And look at how the 25 was the only calculator with an xy and x>0, the 25 had x>=y and x>0, functions that wouldn't appear again until the 15C. I wonder why HP kept changing their mind. RE: Evolution of Conditional Tests - Dave Britten - 01-03-2020 09:36 PM Small correction: the 67 does have x=0 and x=y, for a total of 8 comparison tests. RE: Evolution of Conditional Tests - Thomas Okken - 01-03-2020 11:41 PM My guess would be that they provided eight tests on most of the early calculators because that number could be placed on the keyboard reasonably elegantly, and the choice of which tests were provided probably went something like this: for the comparisons between X and Y, provide one strict and one non-strict inequality, so the missing two can be easily synthesized by swapping X and Y; for the comparisons between X and 0, provide only strict inequalities, because those are used more often than the non-strict ones. N.B. I don't have any inside information on this, I'm just guessing... the differences between the comparison operators are something that I have wondered about many times, and of course they are something one tends to run into when porting programs from one calculator to another! The HP-25 is the odd one out with its choice of inequalities, because they were running out of ROM space. Making the X vs. Y comparisons exactly match the X vs. 0 comparisons saved a few bytes of code in their implementation. RE: Evolution of Conditional Tests - rprosperi - 01-03-2020 11:48 PM (01-03-2020 09:28 PM)David Hayden Wrote:  It's particularly interesting to me to see how things changed from the 67 to the 25 to the 29C. And look at how the 25 was the only calculator with an xy and x>0, the 25 had x>=y and x>0, functions that wouldn't appear again until the 15C. I wonder why HP kept changing their mind. Intro Dates: HP-25: 1975-8-1 HP-67: 1976-7-1 HP-29C: 1977-7-1 So at least for these three models (and noting Dave's correction) they really only changed their mind once. I too used to instinctively react thinking the 67 came out before the 25; it was a similar discussion here a couple years ago that made me research the dates to better understand. It also answers why the 29C seems so different from the 25, but not really not so different from the 67. RE: Evolution of Conditional Tests - Dave Britten - 01-04-2020 12:08 AM The Pioneers are pretty indecisive on this matter too: 20S, 21S: x<=y, x=0 32S: x!=y, xy, x=y, x!=0, x<0, x>0, x=0 (No <= or >= comparisons!) 42S: All 12 comparisons present 32SII: All 12 comparisons present RE: Evolution of Conditional Tests - Valentin Albillo - 01-04-2020 12:26 AM (01-04-2020 12:08 AM)Dave Britten Wrote:  The Pioneers are pretty indecisive on this matter too: 20S, 21S: x<=y, x=0 32S: x!=y, xy, x=y, x!=0, x<0, x>0, x=0 (No <= or >= comparisons!) 42S: All 12 comparisons present 32SII: All 12 comparisons present The subject could be extended to also list the tests which work with alphanumerics in those models having them. For instance, perhaps X=Y? works for either numbers or alpha strings while Xy, x=y, x!=0, x<0, x>0, x=0 (No <= or >= comparisons!) 42S: All 12 comparisons present 32SII: All 12 comparisons present The subject could be extended to also list the tests which work with alphanumerics in those models having them. For instance, perhaps X=Y? works for either numbers or alpha strings while X=0?     X>=Y?       // missing test INST.     INST.       // instruction to execute when the missing test is true ----------------------------------------------------------------------------- X<0?      X=0?     X>=Y?       // missing test INST.     INST.       // instruction to execute when the missing test is true ----------------------------------------------------------------------------- X<0?      X=0?     X<0? INST.     X=0?           INST.``` But what about the X>=Y? and X=Y? : Code: ```HP25  HP67/29/33/34/11 X>=Y?     X<=Y? INST.     X=Y?           INST.``` J-F