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:

Thanks a lot for the patch.


More information about the LibreOffice mailing list