in reply to Code Problem
G'day madM,
In this sort of situation, you need to print out critical values at appropriate points in your code to see why things are, or are not, happening.
The only place you'll output anything (except, perhaps, for error messages) is in the print statement in the second while loop. If you're not printing anything, that suggests the while loop is not being entered. As $DBL_EPSILON is set to 1 and never changes, the while loop will only be entered if ($mutrate > 1.01).
Modifying your code to check that with:
... print "\$mutrate = $mutrate\n"; while ($mutrate-0.01 > $DBL_EPSILON){ ...
I get this output:
$ pm_1048891_test.pl $mutrate = 0.4451357658
That explains your current issue and, hopefully, adds a debugging aid to your toolbox.
-- Ken
|
|---|