random number generators for calc

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Dec 7 17:33:13 PST 2012


Hey tino,

>
> Attached patch is just a simple wrapper around boost, to be used like
>
> sc::rng::seed() to replace libc srand()
> sc::rng::rand() to replace libc rand()

I pushed this part of the patch.

>
> and a few more distributions.

I did not push them. As soon as we have users for them it makes sense
to add them. There is no good reason to add functions that might maybe
used later. If we use them somewhere we can still use the patch for
their implementation.

>
> I've also modified ScInterpreter::ScRandom()
> to simply call sc::rng::uniform()
> which should solve bug 33365.

Pushed that without the old line.

>
> I've not modified RANDBETWEEN(a,b) yet but this could simply call
> sc::rng::uniform_int(a,b).
>
> Also, the rand in Basic could be changed in the future.
>
> Small problems:
>  - compiler warnings from within boost
>  - few asserts might need to be replaced
>

The compiler warning is fixed.

And here the link to the patch:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=8450a99c744e9005f19173e4df35d65640bcf5c4

Thanks a lot for the patch.

Regards,
Markus


More information about the LibreOffice mailing list