Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 11/28/2012 01:00 PM, tino wrote:
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.

Just to be clear, I believe glibc's implementation of rand() is
excellent and doesn't need replacement unless one needs particular
statistical properties (the problem is only with windows rand()).
Boost offers generators I believe similar to glibc's rand() as well as
a few which have even better statistical properties but are slower.
(...)
As for the bug report, if he's referring to

  ./core/sal/inc/rtl/random.h

then I can't see any function we can easily use for our purposes.

Thanks for the additional insight.  Well, I can see two possibilities:

1) Use boost's generator for Windows platform-only, while we keep the glibc's version for Linux. I wonder what the situation is on Mac...

2) Use boost's generator for all platforms.

I don't see the need to replace it for Linux if it's not broken. OTOH, making this platform-dependent may make the maintenance a bit more difficult. Especially when the behavior of the random number generator changes between platforms it may have an undesirable effect. Having said that, since we are talking about random numbers, having slightly different behaviors between platforms may not be such a big issue.

I don't really have any preferences for one over the other. But I do like to see this problem solved especially on Windows.

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.