mardi 29 mai 2018

Mimimum range in PRNG

I was trying to implement some PRNG algorithms in C# (like LCG, Lagged Fibonacci and so on), but I'm not sure about the implementation of a range-constrainted generation. While I understood that the module at the end of the equation is used to limitate to the maximum, I've found no way other than just repeating the process until the result value is greater than the minimum. May I ask if there's a more efficient way to do that?




Aucun commentaire:

Enregistrer un commentaire