M
mahurshi
i have been trying to generate random numbers in perl
and so far, i have been partially successful.
my code is as follows:
for ($i = 1; $i <= 100; $i++)
{
$test = rand(100000);
printf ("%e\n", $test);
}
i am pasting a sample output here:
1.710742e+04
9.492561e+04
3.755295e+04
6.329775e+04
8.602091e+04
8.700460e+03
5.051776e+04
3.425434e+04
8.534643e+03
as you can see, most of the output is in the order of 10^4 and 10^3
i was wondering if there is a way to increase the "swing" in the
randomness
of these numbers, so that i can really see a better mix of numbers of
different magnitudes.
Mahurshi Akilla
and so far, i have been partially successful.
my code is as follows:
for ($i = 1; $i <= 100; $i++)
{
$test = rand(100000);
printf ("%e\n", $test);
}
i am pasting a sample output here:
1.710742e+04
9.492561e+04
3.755295e+04
6.329775e+04
8.602091e+04
8.700460e+03
5.051776e+04
3.425434e+04
8.534643e+03
as you can see, most of the output is in the order of 10^4 and 10^3
i was wondering if there is a way to increase the "swing" in the
randomness
of these numbers, so that i can really see a better mix of numbers of
different magnitudes.
Mahurshi Akilla