Post Reply 
HP41C random number generator help
12-10-2017, 04:09 AM
Post: #26
RE: HP41C random number generator help
(12-09-2017 09:53 PM)Dieter Wrote:  
(12-08-2017 07:43 PM)Dieter Wrote:  Yes, this simply sets the 7th decimal to 3 even if it was another valid digit like 1, 7 or 9 before. ;-)

OK-OK, here is a version that adjust the input only when required.

Code:
LBL "SEED997"
ABS
FRC
1E7
*
INT
RCL X
2
MOD
-
1
+
RCL X
5
MOD
X≠0?
SIGN
ST+ X
-
2
+
1E7
/
STO 00
RTN

Example:
0,1234567 XEQ"SEED997" => 0,1234567
0,2222222 XEQ"SEED997" => 0,2222223

Dieter

Taking things as a challenge is a good thing! Smile OK I will try this one.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP41C random number generator help - Trond - 12-05-2017, 05:45 AM
RE: HP41C random number generator help - Trond - 12-10-2017 04:09 AM



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