Ask Your Question
0

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

asked 2020-04-19 20:01:09 +0100

Lupp gravatar image

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?

edit retag flag offensive close merge delete

Comments

1

It looks the same to me. Basic is here: https://opengrok.libreoffice.org/xref... Calc is here: https://opengrok.libreoffice.org/xref... which uses https://opengrok.libreoffice.org/xref... std::mt19937 std::uniform_real_distribution

Regina gravatar imageRegina ( 2020-04-20 00:54:21 +0100 )edit
1

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

Mike Kaganski gravatar imageMike Kaganski ( 2020-04-22 08:30:17 +0100 )edit

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

Lupp gravatar imageLupp ( 2020-04-22 13:34:45 +0100 )edit

'inept' ...

mikepfarmer@hotmail.com gravatar imagemikepfarmer@hotmail.com ( 2020-06-25 08:49:07 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-04-22 14:56:01 +0100

Regina gravatar image

updated 2020-04-22 14:56:36 +0100

It looks the same to me.

Basic is here: https://opengrok.libreoffice.org/xref...
Calc is here: https://opengrok.libreoffice.org/xref... which uses https://opengrok.libreoffice.org/xref...
Both using std::mt19937 and std::uniform_real_distribution.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-04-19 20:01:09 +0100

Seen: 61 times

Last updated: Apr 22 '20