chowchow for HP-42S « Next Oldest | Next Newest »

 ▼ Mike (Stgt) Posting Freak Posts: 858 Threads: 80 Joined: Feb 2009 11-04-2004, 05:43 AM Nearly 3 weeks ago one hard disk of my PC died away, with all back-up of my 200LX and the M\$-OS and and and... At least I am able again to modifiy my site and like to advertize a little routine for the HP-42S, nothing earth-shattering, just slick and fast. RPN at it's best. Ciao.....Mike ▼ Robin (CH) Junior Member Posts: 5 Threads: 0 Joined: Jan 1970 11-04-2004, 04:07 PM I've written something similar. It doesn't check for "Divide by 0" nor if there only are real numbers, but you can enter the numbers in any order. ```----------------------------------------------------------------------------------------- 06.05.2004/RL XMOD: Zum berechnen des ggT(GCD), kgV(LCM) und gleichzeitigem Kürzen der zwei Werte im X- und Y-Stack USAGE: a ENTER b XEQ"XMOD" DISPLAY: ------------------------- | a/b c d | | as/bs | ------------------------- DESCRIPTION: a= value entered in Y-stack b= value entered in X-stack c= GCD d= LCM as/bs=(a/b)/GCD EXAMPLE: 488 ENTER 12 or alternatively 12 ENTER 488 OUTPUT: 488/12 4 1464 12/488 4 1464 122/3 3/122 ------------------------------------------------------------------------------- 01 LBL "XMOD" 02 X<>Y // SWAP, to get Y 1st one into ALHA 03 CLA 04 AIP 05 ¬"/" 06 STO "Y" 07 X<>Y 08 STO "X" 09 AIP 10 ¬" " // add space in ALPHA between original fraction and GCD 11 X>Y? // if X ST is greater then Y ST then SWAP in prepare to the MOD-command in LBL 00 12 X<>Y 13 LBL 00 // GCD routine 14 MOD 15 X=0? 16 GTO 01 17 LAST X 18 X<>Y 19 GTO 00 20 LBL 01 21 LAST X 22 AIP 23 ¬" " 24 STO "GCD" // store GCD 25 RCL "X" // evaluate LCM 26 RCL* "Y" 27 RCL÷ "GCD" 28 AIP 29 STO "LCM" // store LCM 30 RCL "Y" // evaluate simplified fraction 31 RCL÷ "GCD" 32 ¬"LF" // Line Feed, next line shows simplified fraction 33 AIP 34 ¬"/" 35 RCL "X" 36 RCL÷ "GCD" 37 AIP 38 AVIEW 39 RCL "Y" // not necessary, Restores original y-value 40 RCL "X" // not necessary, Restores original X-value 41 CLV "LCM" // not necessary, deletes variable 42 CLV "GCD" // not necessary, deletes variable 43 END ----------------------------------------------------------------------------------------- ``` ▼ Mike (Stgt) Posting Freak Posts: 858 Threads: 80 Joined: Feb 2009 11-05-2004, 06:11 AM Hi Robin! Tnx a lot 4 your routine. Reminds me that I should dig out mine for calculating with fractions on the HP-41. There is one in the PPC-ROM, but - you know - re-invent a wheel is great fun when it works as designed Ciao.....Mike BTW - see you in Allschwil? ▼ Robin (CH) Junior Member Posts: 5 Threads: 0 Joined: Jan 1970 11-05-2004, 05:33 PM You're welcome :-) I'm not familar with the HP-41, but I'm sure it's a great calc according to what I've read about it several places. Conc. Allschwil: No, it's my birthday on the 27th, and I've already fully planed this day.

 Possibly Related Threads... Thread Author Replies Views Last Post 42s questions and 42s vs 35s snaggs 13 1,835 09-19-2011, 02:44 AM Last Post: snaggs

Forum Jump: