Post Reply 
What are good PRNG for calculators?
11-05-2014, 09:37 PM
Post: #29
RE: What are good PRNG for calculators?
Here is a small program to "display" random numbers on the screen of the HP PRIME...

Code:

EXPORT PRNG()  
BEGIN
  //R:=FP(9821*R+0.211327);
  //R:=FP((PI+R)^5);
  //R:=FP(997*R);
  R:=FP(123*R);
END;

EXPORT PRNG_DSP(A)
BEGIN
 RECT();
 FOR I:=1 TO A DO
  PIXON_P(320*PRNG,240*PRNG);
 END;
 FREEZE;
END;

This program can't assure you that your PRNG program is a good one, but it can show you that it is bad ;D for example FP(123*R)

Don't forget to initialise R with a 0.xxxxxxx number , then :

PRNG_DSP(10000)

or TIME(PRNG_DSP(10000)) to evaluate the complexity of the algorithm
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? - Gilles - 11-05-2014 09:37 PM



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