The question is pretty straightforward. What exactly happens when you use "srand" with no arguments? What is the expected behavior?
srand();
my $x1 = int(rand(65536)) % 65536;
my $x2 = int(rand(65536)) % 65536;
print "$x1\n";
print "$x2\n";
The question is pretty straightforward. What exactly happens when you use "srand" with no arguments? What is the expected behavior?
srand();
my $x1 = int(rand(65536)) % 65536;
my $x2 = int(rand(65536)) % 65536;
print "$x1\n";
print "$x2\n";
According to the documentation:
When called with a parameter, "srand" uses that for the seed; otherwise it (semi-)randomly chooses a seed.