Post Reply 
HP41C random number generator help
12-05-2017, 10:25 PM
Post: #20
RE: HP41C random number generator help
(12-05-2017 06:08 AM)Sylvain Cote Wrote:  HP used this random number generator in lots of places over the years.

FRAC((x * 9821) + 0.211327)

From the GAMES pac:

LBL "RNDM"
RCL 00
9821
*
.211327
+
FRC
STO 00
RTN

Sylvain

Thanks again for this one! I added one more line to avoid the program messing up in case the variable 00 happens to be negative:

LBL "RNDM"
RCL 00
ABS
9821
*
.211327
+
FRC
STO 00
RTN
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-05-2017 10:25 PM



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