HP50g small tips and trick
12-13-2016, 11:58 PM (This post was last modified: 12-15-2016 09:39 AM by Vtile.)
Post: #1
 Vtile Senior Member Posts: 404 Joined: Oct 2015
HP50g small tips and trick
I thought I'll start this kind of thread where users of 50g can share their small tips and tricks of 50g usage. Created after a few seconds of thought.

Writing this from a phone so I'll post exact program tomorrow.

One grey hair and baldness generator is the SOLVE command. As it tends to change the calc to radians and not revert coordinate system back back after calculation so I created a small program to return to the coordinate system it were before Solve command. (There is more sophisticated method in AUR to preserve flag settings)
Another thing is that the SOLVE doesn't like the aprox values in some cases at all and the outcome is messy in general in some cases I like to use it ( ie. real life stuff with ie. values like 1.25 [it is exact value] before symbols and I just want to turn the equation over) so to same solve2.0 program I entered XQ command (thx Han) that converts it to 5/4. NOTE.. 50g converts every plain number even integers to decimal value while pushing them to stack when it is on aprox. mode with some exceptions... (lost plenty of hairs to this, before I understood the bahaviour. This applies also while editing programs :O ).
Third.. One more thing the solve does is that it returns empty list if it do not find any zeros for given equation, doesn't say anything just empty list. Well I added lim(it) command inside a two IFs so now in case it doesn't find zeros it returns a limit of it with tag "limes0:" or proper error message "rational not form found" or similar. This is a sanity check to see what is going on with the solve command.
Lastly it preserves the equation on stack and takes OBJ-> command from the result.

Here is the listing, it is Quick & Dirty, no optimization at all.
Code:
 <<  -105 FS? @Check the flag status to see if the approx mode set?, really can't remember why this... well I leave it there since it do not make any harm @ -17 FS? @Check the flag status to see if the rad mode set?@ -> X Y  @Saves approx flag status to localvariable X and Y is for rad status@   <<  IF 'X==1' THEN -105 CF END @TURNS CALCULATOR TO APPROX.@ DUP2 @PRESERVE THE EQUATION@ DROP @DROPS THE VARIABLE TO SOLVED AGAINST.@ EVAL @IIRC EVAL MADE SOLVE BEHAVE LIKE IT SHOULD IN SOME RARE CASES@ XQ @MAKE EVERYTHING INTEGER BASED .. IF NOT IN SOME DISPLAY MODES RESULT IS TOTAL MESS (TOO MANY DECIMALS SHOWN ETC..)@ SWAP @GET THE VARIABLE BACK TO THE RIGHT PLACE.@ SOLVE  DUP TYPE 5 == IF  @SEE IF RESULT IS LIST (type number for list is 5)@  THEN  DUP SIZE 0 == IF @SEE IF THE RESULT OF SOLVE WERE EMPTY LIST@ THEN DROP 0 lim "Limes0" ->TAG  @Search limit of the equation when variable reaches to zero.@  ELSE OBJ-> @The result weren't empty so there is something interesting there, broke down the list to separate object to the stack for further processing and better display. END ELSE END @first layer of these two last IFs.@ -17 FS? Y ≠ IF @Checks the radians status versus Y acts accordingly@ THEN -17 CF END >>

This is mine small QoL tip, what is yours.
 « Next Oldest | Next Newest »

 Messages In This Thread HP50g small tips and trick - Vtile - 12-13-2016 11:58 PM RE: HP50g small tips and trick - Simone Cerica - 12-15-2016, 10:48 AM RE: HP50g small tips and trick - tdh79 - 12-19-2016, 11:27 AM RE: HP50g small tips and trick - franz.b - 06-13-2018, 10:55 AM RE: HP50g small tips and trick - ttw - 12-19-2016, 07:38 PM RE: HP50g small tips and trick - Carsen - 01-02-2017, 05:21 AM RE: HP50g small tips and trick - Vtile - 01-03-2017, 08:55 AM RE: HP50g small tips and trick - grsbanks - 01-11-2017, 01:29 PM RE: HP50g small tips and trick - Joe Horn - 01-11-2017, 06:32 PM RE: HP50g small tips and trick - Vtile - 01-11-2017, 06:05 PM RE: HP50g small tips and trick - grsbanks - 01-11-2017, 06:56 PM RE: HP50g small tips and trick - DavidM - 01-11-2017, 09:07 PM RE: HP50g small tips and trick - Vtile - 01-11-2017, 11:41 PM RE: HP50g small tips and trick - grsbanks - 01-12-2017, 09:19 AM RE: HP50g small tips and trick - Vtile - 01-17-2017, 01:30 PM RE: HP50g small tips and trick - ttw - 02-06-2017, 07:47 PM RE: HP50g small tips and trick - ttw - 02-20-2017, 09:21 PM RE: HP50g small tips and trick - C.Ret - 06-14-2018, 07:17 AM RE: HP50g small tips and trick - TomC - 06-23-2018, 04:50 PM RE: HP50g small tips and trick - Juan14 - 07-04-2018, 02:55 PM RE: HP50g small tips and trick - Joe Horn - 07-04-2018, 04:52 PM RE: HP50g small tips and trick - DavidM - 07-04-2018, 05:39 PM RE: HP50g small tips and trick - John Keith - 07-04-2018, 05:56 PM RE: HP50g small tips and trick - Carsen - 06-13-2018, 08:12 AM RE: HP50g small tips and trick - Vtile - 06-13-2018, 08:33 PM RE: HP50g small tips and trick - Carsen - 06-13-2018, 09:34 PM RE: HP50g small tips and trick - Joe Horn - 06-14-2018, 05:30 AM RE: HP50g small tips and trick - Vtile - 06-14-2018, 09:30 PM RE: HP50g small tips and trick - Carsen - 06-14-2018, 06:28 AM RE: HP50g small tips and trick - rprosperi - 06-14-2018, 12:08 PM RE: HP50g small tips and trick - Joe Horn - 06-14-2018, 01:09 PM RE: HP50g small tips and trick - DavidM - 06-14-2018, 02:27 PM RE: HP50g small tips and trick - Joe Horn - 06-15-2018, 02:15 PM RE: HP50g small tips and trick - Carsen - 06-15-2018, 08:36 AM RE: HP50g small tips and trick - Joe Horn - 06-15-2018, 03:20 PM RE: HP50g small tips and trick - Carsen - 06-16-2018, 08:40 AM RE: HP50g small tips and trick - brickviking - 08-08-2018, 10:08 AM RE: HP50g small tips and trick - Joe Horn - 06-16-2018, 06:15 PM RE: HP50g small tips and trick - pier4r - 06-16-2018, 07:15 PM RE: HP50g small tips and trick - DavidM - 06-16-2018, 09:26 PM RE: HP50g small tips and trick - grsbanks - 06-17-2018, 07:59 AM RE: HP50g small tips and trick - DavidM - 06-17-2018, 02:29 PM RE: HP50g small tips and trick - Vtile - 06-17-2018, 07:01 PM RE: HP50g small tips and trick - pier4r - 06-23-2018, 03:15 PM RE: HP50g small tips and trick - rprosperi - 06-23-2018, 04:26 PM RE: HP50g small tips and trick - pier4r - 06-23-2018, 05:43 PM RE: HP50g small tips and trick - TomC - 06-23-2018, 05:02 PM RE: HP50g small tips and trick - DavidM - 06-23-2018, 05:35 PM RE: HP50g small tips and trick - Thomas Klemm - 06-30-2018, 01:00 PM RE: HP50g small tips and trick - brickviking - 08-08-2018, 08:44 AM RE: HP50g small tips and trick - pier4r - 08-08-2018, 09:25 AM RE: HP50g small tips and trick - brickviking - 08-08-2018, 10:21 AM RE: HP50g small tips and trick - pier4r - 08-08-2018, 11:18 AM

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