有人知道Activeperl是否使用Windows“stdlib”作为rand和srand函数?我正在使用perl 5.16。提前感谢您的回复。
答案 0 :(得分:-1)
my $s = 4071;
my $rnd = sub {return (($s = ($s * 214013 + 2531011) % 2 ** 31) >> 16 )};
foreach(0..51){print $rnd->()," "}
print "\n";
srand(4071);
foreach(0..51){print rand()*2**15," "}
print "\n";