(38G) Lagged Fibonacci PRNG

07282015, 09:45 AM
(This post was last modified: 06152017 01:56 PM by Gene.)
Post: #1




(38G) Lagged Fibonacci PRNG
For info on theory see:
https://en.wikipedia.org/wiki/Lagged_Fib..._generator LFibSeeder seeds a vector of 127 random integers from 0 to M1, M a positive integer given as input from Ans in the HOME screen. Code:
LFibNext adds the 30th & 127th elements of the vector MODULO M, stores this value as the new first element of the vector, deletes the 128th element of the vector & returns new first element divided by M to Ans in the HOME screen. Code:


« Next Oldest  Next Newest »

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