min(a,b) and max(a,b) equation for HP33S/HP35S  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: min(a,b) and max(a,b) equation for HP33S/HP35S (/thread177995.html) 
min(a,b) and max(a,b) equation for HP33S/HP35S  x34  01302011 HP33s and HP35s lack min and max functions. Yes, they could be easily programmed, but.. So, here is simple (but awkward) brute force implementation of MIN & MAX using Signum function, present on these calculators. MIN(a,b)=((ba)*SGN(ab)+b+a)/2 MAX(a,b)=((ab)*SGN(ab)+b+a)/2 If used in program, they could be simplified by isolating (ab).
Re: min(a,b) and max(a,b) equation for HP33S/HP35S  Dieter  01302011 If I need a min() or max() function in a program I simply do it this way  without any labels and with minimal memory usage: MINfunction: MAXfunction: Okay, this doesn't work for the solver. :)
Looking at your equations for a while I found a somewhat simplified version. Since (ab)*sign(ab) is simply abs(ab) the two equations may be written even shorter this way: MIN(a,b) = (a+bABS(ab))/2By the way thanks for your suggestion  it's always nice to rethink some basics and find solutions one would otherwise not have thought of. :)
Dieter Edited: 30 Jan 2011, 12:47 p.m.
Re: min(a,b) and max(a,b) equation for HP33S/HP35S  x34  01302011 Dieter, thanks for your simplification! I was just solving another problem involving signum function, and suddenly realized that it could be used to emulate MAX/MIN in solver. I wrote the same ABS solution 15 minutes before reading your post :) Your solution is better!
