Post Reply 
HP41C random number generator help
12-09-2017, 09:53 PM
Post: #25
RE: HP41C random number generator help
(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
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 - Dieter - 12-09-2017 09:53 PM



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