include rnd() and randInt() functions to muparser

small bugfix
This commit is contained in:
jmespadero 2023-07-28 14:16:31 +02:00 committed by GitHub
parent 07cb607f58
commit 8a51f54ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ std::default_random_engine rndEngine(randomDev());
//Function to generate a random double number in [0..1) interval
double ML_Rnd() { return std::generate_canonical<double, 24>(rndEngine); }
//Function to generate a random integer number in [0..a) interval
double ML_RandInt(const double a) { return std::floor(a*MyRnd()); }
double ML_RandInt(const double a) { return std::floor(a*ML_Rnd()); }
//Add rnd() and randint() custom functions to a mu::Parser
void setCustomFunctions(mu::Parser& p)