This random script which was copied out of the leon atkinson book simply does not work...
function randomnumber($new_seed="") {
static $seed;
$constant = bcadd(bcpow("2", "13"), "1");
$prime = 37;
$max_value = bcpow("2", "50", $scale);
if ($new_seed != " ") {
$seed = $new_seed;
}
if($seed == " ") {
$seed = strval(time());
}
$seed = bcmul($constant, $seed);
$seed = bcadd($seed, $prime);
$seed = bcmod($seed, $max_value);
return($seed);
}
bcscale(0);
for ($index=0; $index < 100; $index++) {
print(randomnumberr() . "<br>");
}
Could someone please point out the problem here. I think it has something to do with scale.