Evolution of Conditional Tests

01032020, 09:28 PM
(This post was last modified: 01042020 09:39 PM by David Hayden.)
Post: #1




Evolution of Conditional Tests
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: x<y x<0 x<=y x<=0 x>y x>0 x>=y x>=0 x!=y x!=0 x=y x=0 

01032020, 09:36 PM
Post: #2




RE: Evolution of Conditional Tests
Small correction: the 67 does have x=0 and x=y, for a total of 8 comparison tests.


01032020, 11:41 PM
Post: #3




RE: Evolution of Conditional Tests
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 nonstrict 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 nonstrict 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 HP25 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. 

01032020, 11:48 PM
Post: #4




RE: Evolution of Conditional Tests
(01032020 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 x<y test until the 41C. The others all used x<= y. Instead of x>y 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: HP25: 197581 HP67: 197671 HP29C: 197771 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. Bob Prosperi 

01042020, 12:08 AM
Post: #5




RE: Evolution of Conditional Tests
The Pioneers are pretty indecisive on this matter too:
20S, 21S: x<=y, x=0 32S: x!=y, x<y, x>y, x=y, x!=0, x<0, x>0, x=0 (No <= or >= comparisons!) 42S: All 12 comparisons present 32SII: All 12 comparisons present 

01042020, 12:26 AM
Post: #6




RE: Evolution of Conditional Tests
(01042020 12:08 AM)Dave Britten Wrote: The Pioneers are pretty indecisive on this matter too: 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<Y? may or may not work with alpha strings (which would allow sorting easily). Thus, I suggest to expand the table to include tests which do work with alpha data in models having alpha capabilities. It would be informative and can include a surprise or two. V. Find All My HPrelated Materials here: Valentin Albillo's HP Collection 

01042020, 12:33 AM
Post: #7




RE: Evolution of Conditional Tests
(01042020 12:26 AM)Valentin Albillo Wrote:(01042020 12:08 AM)Dave Britten Wrote: The Pioneers are pretty indecisive on this matter too: That's a good point, though I think that only applies to the 41 and 42, correct? The 41 has real numbers and alpha strings, and the 42 adds matrices and complex numbers to that. Then you've also got the 15C with its matrix descriptors that can go on the stack, and I don't know how comparisons behave when you've switched the stack into complex mode. The solver models (17B, 17BII, 27S, 18C, 19B, 19BII) I believe support all six comparison operators in solver equations, with comparisons between any pair of variables or constants. Not sure if the simpler equation solver in the 22S and 32SII supports any comparisons. 

01042020, 12:58 AM
Post: #8




RE: Evolution of Conditional Tests
A little out of subject, but for the HP41 the missing tests can be simulated:
Code: X>=0? X>=Y? // missing test 

01042020, 03:44 AM
Post: #9




RE: Evolution of Conditional Tests
Now you just need to show the 41 with Angel's Warp_Core module!
http://WilsonMinesCo.com (Lots of HP41 links at the bottom of the links page, http://wilsonminesco.com/links.html ) 

01042020, 04:22 AM
(This post was last modified: 01042020 04:23 AM by Sylvain Cote.)
Post: #10




RE: Evolution of Conditional Tests
(01042020 03:44 AM)Garth Wilson Wrote: Now you just need to show the 41 with Angel's Warp_Core module!I am no match for the heavy artillery that you are bringing to the table. Garth is correct to mention the ultimate HP41 ROM that Ángel has created. Go see for yourself here: The Total_Rekall 2019 Module  RCL Math and Full Stack Tests for the HP41  Manual 

01042020, 07:03 AM
(This post was last modified: 01042020 07:05 AM by Ángel Martin.)
Post: #11




RE: Evolution of Conditional Tests
I agree the myriad of tests in the WARP_Core module exceed the intent of this task, but they certainly raise the ante quite a bit. After all it was dubbed "Dare to Compare" ROM for a good reason.
Lest to forget that with the Formula Evaluation ROM you can "design" your own test function, for instance "SQRT(Z+T)<= e^(Xpi.Y) if such a thing suits your fancy ;) Cheers, ÁM 

01082020, 11:11 AM
(This post was last modified: 01082020 05:48 PM by JF Garnier.)
Post: #12




RE: Evolution of Conditional Tests
I always wondered why the 29C tests were so different from the 25/25C, but taking into account the intro date, it makes sense. The comparison tests of the 29C were aligned with the 67 and then adopted for the series 30.
(01042020 12:58 AM)Sylvain Cote Wrote: A little out of subject, but for the HP41 the missing tests can be simulated: Same trick can be used to port a 25/25C program using its specific tests to the HP67/29/33/34/11. Code: HP25 HP67/29/33/34/11 But what about the X>=Y? and X<Y? tests that have no reverse on the HP67/29/33/34/11 ? There is a 3step solution for X>=Y? : Code: HP25 HP67/29/33/34/11 JF 

« Next Oldest  Next Newest »

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