HP Forums

Full Version: (95LX) Linear Congruential Random Number Generator for Solver
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Enter the programme

LCRNG

in Solver.

Store preferred values in R#,AR#, CR# & R#MOD then actuate R# to see the next random number in R# & a random decimal between 0 & 1 in Frct.

Code:

R#=0*IF(AR#=0,L(AR#,7699999939),0)*CR#*IF(R#MOD=0,L(R#MOD, 9199999999999883),0)+L(r,MOD(MOD(MOD(MOD(MOD(L(x,G(R#)-L(i, MOD(G(R#),100000000)))*L(h,G(AR#)-L(j,MOD(G(AR#),100000000))) ,R#MOD)+MOD(G(x)*G(j),-R#MOD),R#MOD)+MOD(G(h)*G(i),-R#MOD),- R#MOD)+G(i)*G(j),-R#MOD)+CR#,R#MOD))+0*L(Frct,G(r)/R#MOD)* Frct
Reference URL's