chowchow for HP-42S



#5

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


#6

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
-----------------------------------------------------------------------------------------


#7

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 <VBG>

Ciao.....Mike

BTW - see you in Allschwil?


#8

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 965 09-19-2011, 02:44 AM
Last Post: snaggs

Forum Jump: