Basic function Rnd() and Calc fuction RAND(): Are they using the same algorithm?

The Calc function RAND() seems to use a common Mersenne twister (Mersenne prime 2^19937−1 ?)
Is this correct?
Is the Basic function Rnd() based on the same algorithm?

It looks the same to me.
Basic is here: methods.cxx (revision 5fc8b470) - OpenGrok cross reference for /core/basic/source/runtime/methods.cxx
Calc is here: interpr1.cxx (revision dbda099d) - OpenGrok cross reference for /core/sc/source/core/tool/interpr1.cxx
which uses random.cxx (revision 8dbe8eac) - OpenGrok cross reference for /core/comphelper/source/misc/random.cxx
std::mt19937
std::uniform_real_distribution

Regina: please re-post as the correct answer! :slight_smile:

Thanks! I still am perfectly inapt to get such findings myself.

‘inept’ …

It looks the same to me.

Basic is here: methods.cxx (revision 5fc8b470) - OpenGrok cross reference for /core/basic/source/runtime/methods.cxx

Calc is here: interpr1.cxx (revision dbda099d) - OpenGrok cross reference for /core/sc/source/core/tool/interpr1.cxx which uses random.cxx (revision 8dbe8eac) - OpenGrok cross reference for /core/comphelper/source/misc/random.cxx

Both using std::mt19937 and std::uniform_real_distribution.