On 11/28/2012 09:17 AM, tino wrote:
Hi,
There are currently only uniform random number generators available in
calc, namely RAND() and RANDBETWEEN(...). I'd be interested in
generators for other distributions, like normal, exponential etc.
I'd suggest using boost/random.hpp and then implementation will be
straight forward. We could also replace rand()/(RAND_MAX+1) in RAND()
with a boost random generator (rand() under windows can be extremely
poorly implemented and only have 2^16 different values or so). This
would also solve this windows only bug:
https://bugs.freedesktop.org/show_bug.cgi?id=33365
Opinions?
So, Michael Stahl commented in the bug that we do have our own random
number generator function. One way is to just replace the direct call
to rand() to this function instead. That should be very easy to do and
I have no objection against it.
Or, is boost's random number generator better than our own? Does anyone
know?
Kohei
--
Kohei Yoshida, LibreOffice hacker, Calc
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.