Thread Unterschiedl. rand-Ergebnisse auf Windows u. Linux (8 answers)
Opened by Gast at 2005-03-08 09:44

kabel
 2005-03-08 12:08
#52409 #52409
User since
2003-08-04
704 Artikel
BenutzerIn
[default_avatar]
also du hast das gleiche skript einmal auf einem win und einmal auf einer linux kiste gestartet und dann kamen unterschiedliche ergebnisse raus?

Code (perl): (dl )
1
2
3
#!/usr/bin/perl -w
srand( 95558 );
print int rand( 61 ), " " for 1 .. 8;


Quote
You can call srand($seed) with the same $seed to reproduce the same sequence from rand(), but this is usually reserved for generating predictable results for testing or debugging. Otherwise, don't call srand() more than once in your program.


rieche ich da einen bug?
jedenfalls steht da nichts von plattformabhängigkeit.
-- stefan

View full thread Unterschiedl. rand-Ergebnisse auf Windows u. Linux