[Gambas-user] Random Numbers Functions info
charlesbukowski.italy at gmail.com
Mon May 9 18:06:10 CEST 2022
I would like to understand how it works with gambas for both randomness and
Many thx for your clear explanation!
Il giorno lun 9 mag 2022 alle ore 16:27 Benoît Minisini <g4mba5 at gmail.com>
> Le 08/05/2022 à 07:08, Charles Bukowski a écrit :
> > Not for any particular reason. I am asking just to understand if
> > randomness level of numbers generated by standard gambas functions is
> > the same/comparable with the analogue rnd functions of more popular
> > programming languages (e.g. c, c++,python,java).
> It depends on what your need.
> Sometimes what you need is reproducibility, and how much random are the
> pseudo-random numbers is not very important.
> Sometimes you need the contrary, usually for cryptographic reasons, and
> you want pseudo-random numbers as much random as possible.
> In gambas, you make the difference with the RANDOMIZE instruction that
> intializes the pseudo-random numbers generator.
> The same seed gives you the same numbers, so you achieve
> reproducibility. At startup, the seed is initialized with the time of
> the day.
> Otherwise, either you directly use what is provided by the OS
> ('/dev/random' or '/dev/urandom') for maximum randomness, either you use
> RANDOMIZE with the result of '/dev/(u)random' to get a random number serie.
> Benoît Minisini
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User