diff options
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/random.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/comphelper/source/misc/random.cxx b/comphelper/source/misc/random.cxx index c695ed12a2f7..9071765585fd 100644 --- a/comphelper/source/misc/random.cxx +++ b/comphelper/source/misc/random.cxx @@ -80,6 +80,9 @@ size_t uniform_int_distribution(size_t a, size_t b) // uniform size_t [a,b) distribution double uniform_real_distribution(double a, double b) { + // Probably too rude to just assert(a < b), so instead... + if (a >= b) + return a; boost::random::uniform_real_distribution<double> dist(a, b); return dist(theRandomNumberGenerator::get().global_rng); } |