recent coverity and rand

Caolán McNamara caolanm at redhat.com
Sat Oct 4 13:23:30 PDT 2014


On Thu, 2014-10-02 at 23:35 +0200, Michael Stahl wrote:
> * direct usage of boost::random for fancy distributions in Calc,
>   sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
> 
> * include/comphelper/random.hxx:
>   double uniform() function with [0,1) range
>   implemented with boost::random / MersenneTwister for speed


> ... so i'd guess that the comphelper/random.hxx approach is most
> promising for general-purpose random numbers (i.e. not crypto); it even
> nicely encapsulates the boost template madness behind a small ABI.
> 
> oh, there is also a <random> header in C++11, likely inspired by
> boost::random; i wonder if our new baseline toolchains have support for
> this... actually GCC 4.5 release notes list it as a new feature, and
> MSVC 2012 has it too:

Hmm, little trap here, uniform_int_distribution takes [a,b] range while
uniform_real_distribution takes [a,b).

C.



More information about the LibreOffice mailing list