Answers for "Linear congruential generator in python"

0

Linear congruential generator in python

def rng(m=2**32, a=1103515245, c=12345):
    rng.current = (a*rng.current + c) % m
    return rng.current/m

# setting the seed
rng.current = 1
for i in range(10):
  rng()
Posted by: Guest on February-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language