Re: [hatari-devel] Hatari_srand() / Hatari_rand()?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 18/01/2024 à 15:44, Christian Zietz a écrit :
Two nitpicky comments (sorry), that are however not meant to argue against the change:
 
You do not call the OS's rand() and srand() function, but the standard library's. The pseudo-random generator state is not shared with other processes/programs. So, for a given Hatari build on a Hatari machine, you will get reproducible random numbers from rand() if you call srand() with a fixed seed. This is guaranteed by the C standard.
 
Of course on a different machine or with a Hatari executable built with a different compiler/standard library, you might get a different sequence of reproducible random numbers, if they implement a different PRNG.
 

Hi,

my bad, you're right, I should have read the man page :)

I mixed the topic with PRNG used with crypto that really try to output non reproducible sequence of numbers.

Nicolas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/