dimanche 10 janvier 2021

How to generate random number between a specific range using exponential distribution?

I'm trying to use std::exponential_distribution to generate a random number that's not constant also in the same time in the range that I want.

std::exponential_distribution has min and max methods.

std::exponential_distribution<double> d;

d.min(10);
d.max(60);

This doesn't compile. Throws an error that too many args for function call and excepted zero.

Aucun commentaire:

Enregistrer un commentaire