vendredi 14 mai 2021

How do I get a logarithmic distribution in C++ with probability P?

I want to write a function in C++.Every time I run this function I get a random integer.The integer fits a Logarithmic distribution with probability p, where p is a number that can be adjusted.I know there are corresponding functions in Python.Link. But I do not know how to write the corresponding function in C ++, I hope to get your help, thank you.




Aucun commentaire:

Enregistrer un commentaire