I think I should not have gone above 39 and 129 - I could test it by getting it to run the thing about 10,000 times...
looks like I'll have to run it 1,000,000 times to catch an error...
A perfect opportunity to finish the port while I'm waiting. And then there's still that quarter bottle of rum...
I stopped it at 200,000... not a single bad result. That's because I suppose when you do rand in perl, it isn't an integer, so rand 40 is really really really unlikely to ever hit 40 on the nose. it's still out there, a rogue likelihood. i think i should set a command running on about 10 million tests or even 100 million tests, to catch it out, but maybe not right now and certainly not on my commercial server!
Quote:
#!/usr/bin/perl
$cow=rand 40;
print $cow;
[root@server cgi-bin]# perl perly.pl
3.06820604313558[cgi-bin]# perl perly.pl
24.8692611913795[cgi-bin]# perl perly.pl
22.6440182543958[cgi-bin]# perl perly.pl
30.7815393462444[cgi-bin]# perl perly.pl
10.5075733765626[cgi-bin]# perl perly.pl
35.189733098414[cgi-bin]#
|
|