03-13-2016, 08:29 AM
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 :
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.
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.