Post Reply 
What are good PRNG for calculators?
08-21-2014, 07:05 PM
Post: #5
RE: What are good PRNG for calculators?
(08-21-2014 03:25 PM)Namir Wrote:  So saying that the Rand# in the HP-15C is very good does not count, because it is already hardwired in the firmware.

This Python program simulates the RAN# function of the HP-15C:
Code:
seed = 7365289446 # or any other number

def rand():
    global seed
    seed = (1574352261 * seed + 1017980433) % 10000000000
    return seed

Of course in the HP-15C the value will be e.g. 0.7365289446 instead.

Cheers
Thomas

PS: It's similar in the HP-48. How RAND Works
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: What are good PRNG for calculators? - Thomas Klemm - 08-21-2014 07:05 PM



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