Hm. I forgot that Perl would upgrade the seed to a float; that needs to be clamped back to a 32-bit integer as the new line below:
{
my $seed;
sub ppSrand{ $seed = int( $_[ 0 ] & 32767 ); }
sub ppRand{
my $max = shift // 1;
$seed = ( $seed * 214013 + 2531011 );
$seed &= 0xffffffff;
return ( ( $seed >> 16 ) & 32767 ) / 32768 * $max;
}
}
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
In the absence of evidence, opinion is indistinguishable from prejudice.
|