HP Forums

Full Version: Mod function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
Because I studyie programs of goods programmers in the library wp34s at southforge, I have see by fortuitousely that a little routine is to MOD operation HP41/
HP42.

Then I remembered of old one for HP32s(ii), from P. Fellerich in 2002. I had tryed
put it in the library but I cannot do. Then I give you :

Code:

LBL'MOD'
x<>y
STO I
x<>y
/
RCL L
x<>y
IP
*
RCL- I
+/-
END

Commentaries was :
Returns the remainder of Y divided by X. The program may seem large for what it does, but it works like a built-in function in that respect that it does not modify stack levels Z and T. Based on the expression Y MOD X = Y - X * IP(Y / X), it doesn't degrade for large Y. It uses i as intermedate storage for Y. LASTx contains the result of the subexpression X*IP(Y/X) afterwards.

Have a good sunday.
(03-13-2016 08:29 AM)ggauny@live.fr Wrote: [ -> ]Then I remembered of old one for HP32s(ii), from P. Fellerich in 2002. I had tryed
put it in the library but I cannot do. Then I give you :

If I understand you correctly, this is a MOD routine for the 34s.
But.... did you notice that the 34s offers both a built-in MOD and a RMDR function ?-)

However, I'm not sure if I correctly understand your intention.

Dieter
For MOD on the 32sii take a look at this old thread.
Hi Dieter,

Yes I know Theses functions exists, and in my head I have your DIVMODE routine, it was only because a similare routine is in library that I give this here.

I remerciat Katie for me write.

Nice day for you all.
Reference URL's